Discussion:
DESTRUCTURING-BIND
Marco Gidde
2004-04-14 10:57:37 UTC
Permalink
The test for &REST comes too late or maybe the error check too early:

COMMON-LISP-USER> (destructuring-bind (&rest rest) nil
(format t "~%rest = ~s" rest))
Debugger invoked on condition of type SIMPLE-ERROR
Available restarts:
--
Marco Gidde
lars-zgYzP9v7iJcdnm+ (Lars Brinkhoff)
2004-04-14 11:11:24 UTC
Permalink
Fixed.

Note that some DESTRUCTURING-BIND features are still missing, e.g.
&aux arguments, and init-form and supplied-p for &key arguments.
--
Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
Marco Gidde
2004-04-14 12:37:33 UTC
Permalink
Post by lars-zgYzP9v7iJcdnm+ (Lars Brinkhoff)
Note that some DESTRUCTURING-BIND features are still missing, e.g.
&aux arguments, and init-form and supplied-p for &key arguments.
It's rough, but enough (for now). Would be nice, if you could use the
stuff already implemented for defun's lambda-lists.
--
Marco Gidde
lars-zgYzP9v7iJcdnm+ (Lars Brinkhoff)
2004-04-14 12:53:12 UTC
Permalink
Post by Marco Gidde
Post by lars-zgYzP9v7iJcdnm+ (Lars Brinkhoff)
Note that some DESTRUCTURING-BIND features are still missing, e.g.
&aux arguments, and init-form and supplied-p for &key arguments.
It's rough, but enough (for now).
All variations of &key argument syntax are implemented now (unless
I've missed something).
Post by Marco Gidde
Would be nice, if you could use the stuff already implemented for
defun's lambda-lists.
Yes, right now there are three separate implementations of lambda list
handling (compiler, interpreter, destructuring-bind). It would be
very nice to unify them, but that would require some deep thought. It
always seem easier to just add another hack to make something new work.
--
Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
Loading...