4 ms·
Yes, that's deliberate. If you use an ordinary `when` (with its statement(s) on the right) then P6 assumes it should succeed with the value of the last stateme
by raiph 7y ago
Yes, that's deliberate.
If you use an ordinary `when` (with its statement(s) on the right) then P6 assumes it should succeed with the value of the last statement of the matched `when`. To succeed means to leave the block and return that last value if the block's value is being kept (eg via a `do`). If you wish instead to proceed to the next statement rather than succeed, you must write `proceed`.
Conversely, if you use a modifier `when` (with its statement(s) on the left) then P6 assumes it should proceed as explained above after matching. If you wish instead to succeed as explained above you must write `succeed` (with a value unless you wish to succeed with a value of `Nil`).
This is great bit of language design work. Thank you Larry.