|
Non-local returnsA block may end with a return statement, causing a return via the lexically- enclosing method activation. The return statement is an expression preceded by an up-arrow (^).
Exercise: Describe the steps taken in executing the following method, once the result of 3<4 is returned:
3 < 4 ifTrue: [^nil]
Exercise: What are the effects of the following expressions?
| b. z. e = (| z <- 7.ÊÊdo: blk = ( blk value: z ) |) | b: [| :x.ÊÊy <- 1 | y: x + y. z: y + z. z printLine]. b value: 3. b value: 4. e do: b. |