Capturing non-local returns?

Avi Bryant avi at beta4.com
Sat May 24 09:25:18 UTC 2003


On Sat, 24 May 2003, Andreas Raab wrote:

> I was wondering if there's a good way of capturing non-local returns and
> ONLY non-local returns from some block. E.g., the problem I'm having is that
> I am evaluating a block and if (and ONLY if) it attempts to do a non-local
> return I want to capture the return and take some appropriate action.

Will this not work?

|normalReturn|
normalReturn := false.
[aBlock value.
 normalReturn := true]
   ensure: [normalReturn ifFalse: [...]]



More information about the Squeak-dev mailing list