all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: defmacro* usage
Date: Wed, 02 Nov 2011 12:28:44 +0100	[thread overview]
Message-ID: <87ipn2rcer.fsf@gmail.com> (raw)

Hi all,
I have an error with following recipe:

#+BEGIN_SRC lisp
(defmacro* test1 (&key (lang 'french))
  `(case ,lang
     (french (message "Bonjour"))
     (english (message "Hello"))))

(test1 :lang 'french)
"Bonjour"
(test1 :lang 'english)
"Hello"
(test1)
Debugger entered--Lisp error: (void-variable french)
  (eql french (quote french))
  (cond ((eql french (quote french)) (message "Bonjour")) ((eql french (quote english)) (message "Hello")))
  (case french (french (message "Bonjour")) (english (message "Hello")))
  (test1)
  eval((test1) nil)
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  call-interactively(eval-print-last-sexp nil nil)


(defun* test2 (&key (lang 'french))
  (case lang
     (french (message "Bonjour"))
     (english (message "Hello"))))

(test2 :lang 'french)
"Bonjour"
(test2 :lang 'english)
"Hello"
(test2)
"Bonjour"

#+END_SRC

As you can see, the quoted default argument 'french cause an error with
the defmacro* and work fine with the defun*.

Is it a bug or i misunderstand something?
Thanks.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




             reply	other threads:[~2011-11-02 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 11:28 Thierry Volpiatto [this message]
2011-11-02 13:02 ` defmacro* usage Andreas Schwab
2011-11-02 13:04 ` Stefan Monnier
2011-11-02 13:15   ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipn2rcer.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.