Subject: Re: Implementation of control structures
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 04 Apr 2006 22:55:21 -0500
Newsgroups: comp.lang.lisp
Message-ID: <qo-dnTiGz7g0oq7ZnZ2dnUVZ_t6dnZ2d@speakeasy.net>
Eli Gottlieb  <eligottlieb@gmail.com> wrote:
+---------------
| Block and return-from actually work now, and as soon as I find out where 
| an environment is being released I'll be using them to make continuations.
| 
| The tough part is going to be tagbody/go.
+---------------

Indeed. I would have started there first, actually, since once
you have the full generality[1] of TAGBODY/GO working you can
easily implement BLOCK and RETURN-FROM in terms of TAGBODY/GO:

    http://home.pipeline.com/~hbaker1/MetaCircular.html

Besides, you need TAGBODY working to implement DO, DOTIMES,
DOLIST, DO-{,ALL-,EXPERNAL-}SYMBOLS and others which have
"implicit tagbodies" in their bodies.


-Rob

[1] Specifically, the ability to GO from within a nested LAMBDA:

      > (tagbody
	  (mapc (lambda (x)
		  (print x)
		  (when (eql x 13)
		    (go bye-bye)))
		'(3 5 6 13 1 2 7 8))
	  bye-bye)

      3 
      5 
      6 
      13 
      NIL
      > 

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607