[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unreadable forms as default in macros
- To: <clisp-list@ma2s2.mathematik.uni-karlsruhe.de>
- Subject: Re: unreadable forms as default in macros
- From: Bruno Haible <haible@ilog.fr>
- Date: Tue, 30 Sep 1997 19:07:33 +0200 (MET DST)
- >received: from halles.ilog.fr (halles.ilog.fr [172.16.1.96]) by ilog.ilog.fr (8.8.7/8.7.3) with ESMTP id TAA09707; Tue, 30 Sep 1997 19:07:32 +0200 (MET DST)
- In-reply-to: <9709308756.AA875629837@inet.stknhlg.com>
- References: <9709308756.AA875629837@inet.stknhlg.com>
Sam Steingold <sshteingold@cctrading.com>:
>
> E.g..
> > (defmacro zz (&optional (rt *readtable*)) rt)
> zz
>
> So, what do I do wrong?
When you have problems with macros, it helps to call `macroexpand-1' on
a form, for example:
> (macroexpand-1 '(zz))
#<READTABLE #x0004D0> ;
T
Now, #<READTABLE #x0004D0> is not a valid program according to CLtL1
(neither a symbol, list, number, character nor bit-vector). What do you
want to have (macroexpand-1 '(zz)) to yield?
Either (macroexpand-1 '(zz)) ==> '#<READTABLE #x0004D0>
then (zz) will be the value of *readtable* at macro expansion time
(i.e. maybe compile time).
Or (macroexpand-1 '(zz)) ==> *READTABLE*
then (zz) will be the value of *readtable* at run time.
Bruno