aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/posts/ruby-then-keyword-and-case-in/index.html
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2022-03-02 20:21:49 +0900
committernsfisis <nsfisis@gmail.com>2022-03-02 20:21:49 +0900
commit80a0076402d1e6d6bde6c2f9fb78e1eb285ea500 (patch)
treeb46e0de2f3199d9d2afcc4fd28980ada94d64c31 /docs/posts/ruby-then-keyword-and-case-in/index.html
parent0ecfd8dbc7a798d8fa58219d84387b6b30d4a2f4 (diff)
downloadnsfisis.github.io-80a0076402d1e6d6bde6c2f9fb78e1eb285ea500.tar.gz
nsfisis.github.io-80a0076402d1e6d6bde6c2f9fb78e1eb285ea500.tar.zst
nsfisis.github.io-80a0076402d1e6d6bde6c2f9fb78e1eb285ea500.zip
enable hasCJKLanguage
Diffstat (limited to 'docs/posts/ruby-then-keyword-and-case-in/index.html')
-rw-r--r--docs/posts/ruby-then-keyword-and-case-in/index.html6
1 files changed, 1 insertions, 5 deletions
diff --git a/docs/posts/ruby-then-keyword-and-case-in/index.html b/docs/posts/ruby-then-keyword-and-case-in/index.html
index 08e90bd..c485f68 100644
--- a/docs/posts/ruby-then-keyword-and-case-in/index.html
+++ b/docs/posts/ruby-then-keyword-and-case-in/index.html
@@ -7,11 +7,7 @@
<title>[Ruby] then キーワードと case in - REPL: Rest-Eat-Program Loop</title>
- <meta name="description" content="この記事は Qiita から移植してきたものです。 元 URL: https://qiita.com/nsfisis/items/787a8cf888a304497223
- TL; DR case - in によるパターンマッチング構文でも、case - when と同じように then が使える (場合によっては使う必要がある)。
-then とは 使われることは稀だが、Ruby では then がキーワードになっている。次のように使う:
-if cond then puts &#34;Y&#34; else puts &#34;N&#34; end このキーワードが現れうる場所はいくつかあり、if、unless、rescue、case 構文がそれに当たる。 上記のように、何か条件を書いた後 then を置き、式がそこで終了していることを示すマーカーとして機能する。
-# Example: if x then a end unless x then a end begin a rescue then b end case x when p then a end なぜ普段は書かなくてもよいのか 普通 Ruby のコードで then を書くことはない。なぜか。次のコードを実行してみるとわかる。">
+ <meta name="description" content="この記事は Qiita から移植してきたものです。 元 URL: https://qiita.com/nsfisis/items/787a8cf888a304497223 TL; DR case - in によるパターンマッチング構文でも、case - when と同じように then が使える (場合によっては使">
<meta name="author" content="">
<link href="https://blog.nsfisis.dev/an-old-hope.min.css" rel="stylesheet">