HI-
I have a small problem. I am wrting a macro which takes (in part) a
list of lists. I want to verify that what is passed is actually a
list of lists before I generate the expansion. So I have:
(defmacro foo (some-list)
(if (not (every #'listp some-list) )
(error "Parameter 'some-list' is not a list of lists.") )
; ... textual substituion done here...
)
I am finding that the error always occurs, even when some-list is
really a list of lists.
Thanks in advance.
·········@ptcstudios.com
In article <····························@4ax.com>,
<········@ptcstudios.com> wrote:
>HI-
>
>I have a small problem. I am wrting a macro which takes (in part) a
>list of lists. I want to verify that what is passed is actually a
>list of lists before I generate the expansion. So I have:
>
>(defmacro foo (some-list)
> (if (not (every #'listp some-list) )
> (error "Parameter 'some-list' is not a list of lists.") )
>
> ; ... textual substituion done here...
>)
>
>
>I am finding that the error always occurs, even when some-list is
>really a list of lists.
Remember that the macro's parameters are the sub-expressions of the
invoking form, *not* the run-time values of those expressions.
If you need to check the value of a variable, you have to put the check
into the expansion, not do it in the macro itself.
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.