From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How the backquote and the comma really work? Date: Thu, 25 Jun 2015 20:46:26 +0200 Message-ID: <87k2urfwxp.fsf@mbork.pl> References: <87vbebg1fs.fsf@mbork.pl> <1e190a42-19c5-4755-b263-4334c402619a@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435258014 16449 80.91.229.3 (25 Jun 2015 18:46:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jun 2015 18:46:54 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 25 20:46:45 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 1Z8CAf-0004wt-B9 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 20:46:45 +0200 Original-Received: from localhost ([::1]:57059 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8CAe-0000dI-Ip for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jun 2015 14:46:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8CAU-0000dD-0q for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 14:46:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8CAR-00035m-9j for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 14:46:33 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:54386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8CAR-00034e-1Y for help-gnu-emacs@gnu.org; Thu, 25 Jun 2015 14:46:31 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 5FED06F2002 for ; Thu, 25 Jun 2015 20:46:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uJb8I7CY8v9u for ; Thu, 25 Jun 2015 20:46:28 +0200 (CEST) Original-Received: from localhost (ipz217.internetdsl.tpnet.pl [79.190.154.217]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3E1314F607B for ; Thu, 25 Jun 2015 20:46:28 +0200 (CEST) In-reply-to: <1e190a42-19c5-4755-b263-4334c402619a@default> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 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:105172 Archived-At: On 2015-06-25, at 20:10, Drew Adams wrote: >> So, I assume that when Emacs Lisp interpreter encounters a >> backquote, it looks at the expression after it. If it is anything >> but a list, it just works like the usual quote, and the backquoted >> expression evaluates to what was backquoted. > > Not really. A comma (& additional backquotes & additional commas...) > still tells the backquote preceding it to evaluate whatever sexp the > comma precedes. > > So `,foo evaluates variable foo, and `',foo evaluates foo and quotes > the result. > > (setq foo 'bar) ; => bar > (setq toto `,foo) ; => bar > (setq titi `',foo) ; => 'bar > > (setq titi `',foo) is equivalent to (setq titi (list 'quote foo)) > > Michael H's advice about following the macroexpansion is good. Thanks, I stand corrected! -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University