Friday, March 14, 2008

 

Arc continuation puzzle

In case anyone thinks continuations are straightforward, I've ported Eugene Kohlbecker's classic Scheme puzzle to Arc. What does (mondo-bizarro) print?
(def mondo-bizarro ()
  (let k (catch throw)
    (pr 1)
    (catch (k throw))
    (pr 2)
    (catch (k throw))
    (pr 3))
  nil)
Reference: ACM SIGPLAN Lisp Pointers, Volume 1, Issue 2 (June-July 1987) pp 22-28.

Comments:
The original Scheme mondo-bizarro and the same using The Seasoned Schemer's letcc.

(I see mondo-bizarro has already appeared in public so I assume there's no copyright problem here.)
 
Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]