Home
Feedback
FAQ
Getting Started
Discussions
Site operation discussions
Recent Posts
(new topic)
Departments
Courses
Research Papers
Design Docs
Quotations
Genealogical Diagrams
Archives
It's way too quiet around here, so maybe you'd want to check this blog entry about ST exception handling. Here's the juicy bit:
In Smalltalk... the stack is an argument held in the exception.
It must be me. I can understand how it might be handy receiving the (caller's local) stack in exceptions for debugging inspection, but in all other cases having 'resumable' exceptions has a couple of drawbacks:
Like I said, it must be me.
It's really cool to have these primitives so that you can write your own debugger as just another program. I would love to have this in Erlang!
I think it's a great principle to try burning yourself with each of these powerful ideas instead of shying away. They aren't that dangerous!
I remember you had a blast watching the Squeak video. I think you'll find the 10/13/2005 Croquet video a lot of fun too.
PL/I signals had this feature, and Multics made much use of it, apparently. In fact, the way to get what we think of today as "normal" exception semantics was to do a GO TO out of the condition handler (e.g., ON ENDFILE GO TO CALCULATE); if you fall off the end, that returns to what caused the signal.
PL/I also supported nested procedures and interprocedure GO TO; so, the ON statement could be thought of — or even implemented, I think — as just a lambda (uh, I mean, "nested procedure") passed to something like C's signal() (except automatically removed at the end of the scope).
Something to think about, maybe.
(Disclaimer: I haven't actually written any PL/I, just read about it; and the nth-hand copy of PL/I for Programmers that I have appears to be older than me.)
So what you're saying is that you want to be able to bind exception throw behaviour dynamically, rather than lexically. The end result being that a caller can bind handler code into any (uncaught) exception throw, without having any way of knowing the source(s) of the possible exceptions, or their root cause.
How, exactly, is one supposed to document the exceptional behaviour of a library class in that case? What possible security gaurantees could one give, if a calling library can inject arbitrary code on any error condition, and ignore or mask the error as it will? How would you even exhaustively test such a thing, other than by ignoring the horrible stuff that your caller could have done to you and pretending you're in some some language?
Aren't exception handlers always bound dynamically not lexically?
In languages with non-restartable exception handlers, the location of error handling is bound dynamically, but the handler can only make effects via it's lexical scope. By having the stack as an argument, the handler code has available the dynamic scope of the throw locations.
The Common Lisp condition system also supports resumable conditions, and the definition of protocols for handling those conditions.
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 17 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago