164 posts
|
The comment for insure is:
ensure: terminationBlock
"Evaluate the receiver, and regardless of the means by which it exits,
be it by normal or non-local (^) return, or by raising an exception,
evaluate
the <niladicBlock> argument, terminationBlock.
Answers the result of evaluating the receiver, unless <terminationBlock>
contains a non-local return, in which case the result of <terminationBlock>
will be
answered to its home contexts sender, e.g.:
[^1. 2] ensure2: [Sound bell] answers 1, but also woofs
[^1. 2] ensure2: [Sound bell. 3] woofs and answers 3.
[1. 2] ensure2: [Sound bell. ^3] ditto
[1. 2] ensure2: [Sound bell. 3] woofs and answers 2
See also #ifCurtailed:"
I'm not sure why the examples have #ensure2 instead of #ensure:. Also, the
second example is wrong - it answers 1.
jlo
|