Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case の挙動の明確化 #2843

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions refm/doc/spec/control.rd
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ end
式..]
end

case は一つの式に対する一致判定による分岐を行います。when
節で指定された値と最初の式を評価した結果とを演算子 === を用いて
比較して、一致する場合には when 節の本体を評価します。
case は一つの式に対する一致判定による分岐を行います。
上から順番に、when の直後の式を評価した結果をレシーバ、
case の直後の式を評価した値を引数として === 演算子を呼び出し、
最初に真を返した when 節の本体を実行します。

どの when 節でも条件が成立しなかった場合は、else 節を実行します。

つまり、

Expand Down