Assume we have the following sequence of methods:
m1
self m2: [^1]
m2: block
self m3: block.
Processor := nil "crash!"
m3: block
[block value] ensure: [^2]
The question is what's the value of anObject m1
?
In other words, is the semantics of [ˆ2]
well defined as an ensured block? There are two possibilities:
- The return from block is ignored in ensured blocks: In this case
m1
will return with1
. - The return from block is honored in ensured blocks: In this case the image will crash.
Please note that I'm not asking what will happen. I'm rather interested in the definition of the execution flow.
EDIT
COROLLARY 1 (as confirmed by Lukas in his answer below): Not a good programming style!