Help - how to pass a "keyed parameter list" to a macro or function - beginner is at wits end
David Koch <[email protected]> Fri, 02 Jul 2004 01:38:58 -0500
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <[email protected]> |
How can I pass a keyed argument list to a function ? to a macro?
For example:
(setf aspec '(:a 1 :b 2 :c 3))
(defclass obj () (a b c))
(make-instance 'obj aspec) <<<<<
>>> Malformed plist in doplist, odd number of elements.
Clearly aspec is being evaluated before the call to make-instance
so I have been trying something like:
(defmacro create-obj (arg)
`(make-instance 'obj ,@arg))
This does not expance correctly, and I have tried everything under the
sun that I could think of , except the correct method?
Any suggestions?
Thanks,
David Koch
[email protected]