Discussion of Common Lisp
-
August
- Posts: 17
- Joined: Fri Oct 03, 2008 1:41 pm
- Location: Los Alamos, New Mexico USA
-
Contact:
Post
by August » Sat Nov 26, 2011 7:26 pm
I was playing around with DO in Lispworks and did a macro expansion of a simple example.
Code: Select all
(BLOCK NIL
(LET ((I 0))
(DECLARE (IGNORABLE I))
(DECLARE)
(TAGBODY
#:G727 (WHEN = (RETURN-FROM NIL (PROGN I 10)))
(PRINT "hello")
(SETQ I (1+ I))
(GO #:G727))))
This all makes sense to me except for the (when = (...)). Shouldn't there be a test form where the "=" resides? I did the same expansion in Clozure CL and it is similar, but uses an (unless = (...)).
-
jcbeaudoin
- Posts: 2
- Joined: Sat Nov 26, 2011 10:33 pm
Post
by jcbeaudoin » Sat Nov 26, 2011 10:40 pm
What you show seems to be coming from the macro expansion of DO* rather than DO.
The end-test-form of your DO* is most probably at the wrong nesting level, just add a pair of parentheses ( ) around it.
-
August
- Posts: 17
- Joined: Fri Oct 03, 2008 1:41 pm
- Location: Los Alamos, New Mexico USA
-
Contact:
Post
by August » Sun Nov 27, 2011 10:57 am
It was definitely a DO form and I tested it to make sure it worked as expected but, you're right, I must have missed a pair of parenthesis somehow when doing the expansion
Thanks much.