3 ms·
Neat trick, but still an example of Greenspan's 10th ("Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, s
by patrickmay 12y ago
Neat trick, but still an example of Greenspan's 10th ("Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.").
The Common Lisp condition system (http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html http://www.gigamonkeys.com/book/beyond-exception-handling-co...) is worth understanding, even if you're developing in other languages. It's an elegant example of how to manipulate the call stack. Unfortunately, it's hard to implement in most other languages.
- webkike 12y agoI've always wondered: if I implement Common Lisp in C or Fortran, what does that say about Common Lisp?
- pkhuong 12y agoThere is no special call stack manipulation in the CL condition system. It's built on top of dynamic scoping and normal catch/throw unwinds; see http://www.pipeline.com/~hbaker1/MetaCircular.html http://www.pipeline.com/~hbaker1/MetaCircular.html for block/return-from on top of catch/throw.
- patrickmay 12y agoIndeed, but the Common Lisp condition system exposes it and wraps it elegantly.