From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: defmacro* usage Date: Wed, 02 Nov 2011 14:15:10 +0100 Message-ID: <87ehxqr7hd.fsf@gmail.com> References: <87ipn2rcer.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1320239734 30711 80.91.229.12 (2 Nov 2011 13:15:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2011 13:15:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 02 14:15:29 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RLafA-0007k3-5U for ged-emacs-devel@m.gmane.org; Wed, 02 Nov 2011 14:15:28 +0100 Original-Received: from localhost ([::1]:53167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLaf9-0005JI-DM for ged-emacs-devel@m.gmane.org; Wed, 02 Nov 2011 09:15:27 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLaf3-0005Ie-K1 for emacs-devel@gnu.org; Wed, 02 Nov 2011 09:15:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLaez-00082u-9R for emacs-devel@gnu.org; Wed, 02 Nov 2011 09:15:21 -0400 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:52878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLaez-00082U-3X for emacs-devel@gnu.org; Wed, 02 Nov 2011 09:15:17 -0400 Original-Received: by faaf16 with SMTP id f16so546028faa.0 for ; Wed, 02 Nov 2011 06:15:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=8AsaVT8HVQnepp12dlZvG9XACuhQLf6AhC9IRuc7QeM=; b=acGl2sDCiZ3pWvyfqjQpytO+FXOsrxPbCVVEwPukIBCSuf/v3i1Hsb6jlOkndyqbLG Oic5dKsyE49jUU9x0QCgswmpB6eDe0OTM5FYiG2yyA0RA7zTSoAiqUgYd0DhKsRnJhnh JxUhnobSeE6a6u3zZVboOyv4cnBdpvV4Bh0zA= Original-Received: by 10.223.63.206 with SMTP id c14mr8541994fai.3.1320239715729; Wed, 02 Nov 2011 06:15:15 -0700 (PDT) Original-Received: from thierry-MM061 (205.77.197.77.rev.sfr.net. [77.197.77.205]) by mx.google.com with ESMTPS id d21sm5406431fac.4.2011.11.02.06.15.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Nov 2011 06:15:14 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 02 Nov 2011 09:04:07 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145836 Archived-At: Stefan Monnier 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