I need to create a function that starts off with several keyword
arguments followed by a body. This is just fine with a destructuring
bind, but the function chokes.
What am I doing wrong and how do I work around this?
? (destructuring-bind ((&key a) &rest b) '((:a b) a)
(list a b))
(B (A))
? ((lambda ((&key a) &rest b) (list a b)) '((:a b) b))
> Error: While compiling an anonymous function :
> Bad lambda list : ((&KEY A) &REST B)
> Type Command-. to abort.
See the Restarts� menu item for further choices.
1 >
--
B.B. --I am not a goat!
In article <··················································@library-proxy.airnews.net>,
Bryant Brandon <········@airmail.net> wrote:
> I need to create a function that starts off with several keyword
>arguments followed by a body. This is just fine with a destructuring
>bind, but the function chokes.
Function parameter lists don't allow nested lambda lists. They're only
allowed in macros and DESTRUCTURING-BIND.
So you should define your function to take a single argument, and then use
DESTRUCTURING-BIND.
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.