From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: understanding backquote Date: Wed, 03 Jun 2015 13:05:51 +0200 Message-ID: <87iob5uk4w.fsf@members.fsf.org> References: <87vbf65jem.fsf@free.fr> <87mw0hly26.fsf@aol.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433345999 24133 80.91.229.3 (3 Jun 2015 15:39:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jun 2015 15:39:59 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Olaf Rogalsky Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 03 17:39:50 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z0AlU-0008Ku-KE for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Jun 2015 17:39:36 +0200 Original-Received: from localhost ([::1]:36280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AlU-0004hm-25 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Jun 2015 11:39:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z06Ug-0008CR-SL for help-gnu-emacs@gnu.org; Wed, 03 Jun 2015 07:06:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z06Ub-0000gY-Cm for help-gnu-emacs@gnu.org; Wed, 03 Jun 2015 07:05:58 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:35296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z06Ua-0000eJ-Qb for help-gnu-emacs@gnu.org; Wed, 03 Jun 2015 07:05:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgIFACjfblWkD4Xx/2dsb2JhbABbg2ReAYJPqgEGk2CFdwKCEgEBAQEBAYELhCMBAQMBeQULCAMhJQ8BBEkTiBgDCggN2jIBAQEHAgEfhhmFKoJNgjkHhC0FkFOGeIgTPoYEi3uDWSODejwxAQGCRQEBAQ Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 03 Jun 2015 13:05:51 +0200 In-Reply-To: <87mw0hly26.fsf@aol.de> (Olaf Rogalsky's message of "Tue, 02 Jun 2015 21:17:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-Mailman-Approved-At: Wed, 03 Jun 2015 11:37:58 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104733 Archived-At: Olaf Rogalsky writes: > (defun test () `,(* (+ 1 2) (+ 3 4))) > > Now let's have a look at the defintion of the symbol: > > (symbol-function 'test) > => (lambda nil (* (+ 1 2) (+ 3 4))) > Huhh??? I agree with your surprise. > I was thinking, that the above definition is equivalent to the > following: > > (defun test () 21) But mine goes in the opposite direction : (defun test () `,(* (+ 1 2) (+ 3 4))) should yield (symbol-function 'test) => (lambda nil (\` (\, (* (+ 1 2) (+ 3 4))))) However, evaluating with C-x C-e or C-M-x gives what you mentionned: (lambda nil (* (+ 1 2) (+ 3 4))) *But* if you evaluate the defun with M-:, then we get what I expected. Why is that ? Because of eager macroexpansion (see http://article.gmane.org/gmane.emacs.help/103223). As another example, hitting C-x C-e after: (defun foo (bar) (eval-when-compile (message "bar"))) will produce "bar" in your *Messages* buffer, but it doesn't happen using M-:. HTH, -- Nico