The State of Exceptions

Sheldon Nicholl sheldonn at teleport.com
Tue Oct 13 04:04:48 UTC 1998


I really feel like I'm going out on a limb by saying this, but I think
Smalltalk would be a better language if non-local returns were
removed entirely. They cause trouble all across the board, from
the Debugger to the VM to beginning Smalltalkers trying to learn
the language.

The clean solution is continuations. Otherwise raise an exception.


-----Original Message-----
From: Tim Rowledge <rowledge at interval.com>

>A non-local return can jump from one context back up to another without
>passing Go, thereby causing untold trouble. The VM mod would scan up the
>stack from source to target, checking for marked contexts on the way; any
>marked context found woud be sent a suitable message, somewhat like
>#cannotReturn:. Indeed, somebody (Andreas?) mentioned the possibility of
>overloading the cannotReturn handling to provide unwind protection. Sounds
>plausible to me.


The problem here of course is what to do when the target is no
longer on the stack.

           --Sheldon Nicholl





More information about the Squeak-dev mailing list