Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct usage of destructuring-bind

I'm experimenting with destructuring-bind as follows:

(destructuring-bind
           (a  b) '(1  2) (list a b)))

When I evaluate this in the REPL I get:

READ from #1=#<INPUT STRING-INPUT-STREAM>: an object cannot start with #\)
   [Condition of type SYSTEM::SIMPLE-READER-ERROR]

I expected the result to be

(1 2)

The error doesn't mean anything to me, in the context of the code above.

I realise that I'm just binding a simple list of arguments, rather than a tree, but I still expecteded this to work. Any clues as to where I've gone wrong?

like image 338
Joel Avatar asked Dec 04 '22 10:12

Joel


1 Answers

Remove the extra ) on the end. Works fine.

like image 194
Demosthenex Avatar answered Feb 04 '23 03:02

Demosthenex