I'd like to implement the proposed Smalltalk ANSI standard exception protocols in Squeak. Is there an exception handling implementation for Squeak relatively complete? Enough so that the ANSI standard exception protocols could implemented using it. I used Hal Hildebrand's implementation when doing this for Smalltalk Express.
In March, Dave Farber posted a Squeak version of exception handling. (Dave: yes, it's very useful ;) Is there a more recent version?)
thanks Bijan. there is not a more recent version. several reasons for this:
- i have not received any bug reports :) 2) i got sidetracked from some
stuff that had sidetracked me from some other stuff that had sidetracked me from working more on exceptions 3) i don't know that i really like PP's interface. at the very least i would what to swap do:handle: for handle:do:.
i did find one bug. i had commented out one snippet of code that checked to see if the exception on the stack was the right type for the handler found. so now, the first handler found will always execute, regardless of the exception type.
if any one has has any fixes, extensions, or more exception definitions, feel free to pass them along.
dave
Hi, Dave!
It's been a while since I looked into this, but I believe that Squeak lacks some critical VM support for unwind blocks. But I haven't looked at what your implementation; were you able do everything you needed to do without any VM support? Does your implementation support unwind blocks (the "ensure:" mechanism)? If not, how badly is it missed?
I suggest that whenever there is a disagreement between the proposed ANSI Smalltalk standard and some vendor's implementation, Squeak's exception handling should lean toward the ANSI standard. (E.g., "ensure:" versus "valueNowOrOnUnwindDo:"). Presumably Smalltalk vendors will be gradually migrating toward the standard over the next several years.
-- John