views:

297

answers:

4

My questions are more of historical nature than practical:

  1. Who invented it?
  2. Which language used it first (and to what extent)?
  3. What was the original idea, the underlying concept (which actual problems had to be solved these days, papers welcome) ?
  4. Is LISPs condition system the ancestor of current exception handling?
+1  A: 

Have a look at this post.

Justin Ethier
Thanks! But I'd also appreciate answers to questions 3 and 4.
frunsi
+3  A: 

Today's Common Lisp condition system is a relative newcomer. The design was based on previous systems, but wasn't included as part of the Common Lisp language until the late 80's around the time of CLTL2

I believe the conditions chapter in that book has a fair amount commentary on the history and background of the design, and references to related research and prior implementations of similar systems.

abeyer
+2  A: 

The VAX CPUs had a stack-based exception handling system. In every call frame, one 32-bit cell was allocated and filled with a zero. If the subroutine being called wanted to handle exceptions, all it had to do was fill in that cell with the address of the exception-handling routine.

When an exception took place, a stack search would occur. This was easy, since the stack frames were all chained together. The first stack frame with a non-zero entry would cause an stack unwind to that point, and the exception handler would be called.

I remember this as being one of the features of the processor which were aimed at higher-level languages, but I don't know that there was a higher-level language that took advantage of the feature. I believe it was used by library code, which would likely have been written in assembler.

John Saunders
A: 

Doesn't it go back to the setjmp, longjmp functions in C? Richie, Kernighan, et al?

Mike Dunlavey