Destructuring-bind



Greetings!  Yes, my apologies, my mistake -- I just copied the text
from the spec without altering for my different iota.

The problem is that this code gives NIL in place of BEE.  Anyone know
why? 

Take care,


Richard Fateman <fateman@cs.berkeley.edu> writes:

> I assume you mean the correct answer to be (alpha bee 5 4 3)
> which is what Allegro CL gives.
> RJF
> 
> 
> Camm Maguire wrote:
> 
> > Greetings!  As you may know, I lifted the destructuring-bind James had
> > setup in maxima and added it to gcl-2.5.0.
> > 
> > Problem is, it doesn't quite give the correct  result for the example
> > listed in the ansi hyperspec.  To wit:
> > 
> > (defun iota (n) (list n (+ n 1) (+ n 2)))
> > 
> > IOTA
> > Top level.
> > 
> >>     (destructuring-bind ((a &optional (b 'bee)) one two three)
> >>
> >           `((alpha) ,@(iota 3))
> >         (list a b three two one))
> > 
> > (ALPHA NIL 5 4 3)
> > 
> > (not (ALPHA BEE 3 2 1))
> > 
> > I've included the code below.  Could some lisp hacker spot the error?
> > 
> > Take care,
> > 
> > 
> > 
> 
> 
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah