[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defmacro* usage
From: |
Thierry Volpiatto |
Subject: |
Re: defmacro* usage |
Date: |
Wed, 02 Nov 2011 14:15:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> I have an error with following recipe:
>
>> #+BEGIN_SRC lisp
>> (defmacro* test1 (&key (lang 'french))
>> `(case ,lang
>> (french (message "Bonjour"))
>> (english (message "Hello"))))
> [...]
>> As you can see, the quoted default argument 'french cause an error with
>> the defmacro* and work fine with the defun*.
>
> The error is not from defmacro* but from the code you generated using
> defmacro*.
>
>> Is it a bug or i misunderstand something?
>
> A misunderstanding. Think harder about what your macro does. E.g. try
> (macroexpand '(test1 :lang 'toto)) and (macroexpand '(test1)).
> During macroexpansion, your `lang' is not supposed to hold a "language
> value" but "a Lisp expression that will evaluate to a language value".
Ok, thanks for explanation.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997