From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Olaf Rogalsky Newsgroups: gmane.emacs.help Subject: Re: understanding backquote Date: Wed, 03 Jun 2015 00:53:17 +0200 Message-ID: <87lhg1lo2q.fsf@aol.de> References: <87vbf65jem.fsf@free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1433285704 15555 80.91.229.3 (2 Jun 2015 22:55:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2015 22:55:04 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Barry Margolin Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 03 00:54:58 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 1Yzv46-0006p4-2c for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Jun 2015 00:53:46 +0200 Original-Received: from localhost ([::1]:32936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzv40-0004wa-Kb for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Jun 2015 18:53:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzv3q-0004wR-6P for help-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:53:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzv3k-0003du-9E for help-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:53:30 -0400 Original-Received: from omr-m4.mx.aol.com ([64.12.226.25]:45607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzv3k-0003dV-33 for help-gnu-emacs@gnu.org; Tue, 02 Jun 2015 18:53:24 -0400 Original-Received: from mtaout-aak02.mx.aol.com (mtaout-aak02.mx.aol.com [172.27.2.226]) by omr-m4.mx.aol.com (Outbound Mail Relay) with ESMTP id 90FCF38000061; Tue, 2 Jun 2015 18:53:22 -0400 (EDT) Original-Received: from blaubaer (p5DD06311.dip0.t-ipconnect.de [93.208.99.17]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mtaout-aak02.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id DEE6138000091; Tue, 2 Jun 2015 18:53:21 -0400 (EDT) In-reply-to: x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20140625; t=1433285602; bh=FF+B/oZFOXqENPUt1eHPXGZgMnaHUe+4xkfwivsONn4=; h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type; b=Skt+KUvGPsfdwmB9rKW+bFgB8xEtcdl6RcsVZtQrTUuSyyvUbAqxmwclVL7qhhjXg aXm0LRTXW8SkbfT8IG9nJE1IPMH5VVv7iJ3fpumGdopVK1YoPNoO2BYMqWVJt8cmBy yW7v0+sLKdpT65pJivkjrDT//6/3C5vU0uZPWpH4= x-aol-sid: 3039ac1b02e2556e33e15394 X-AOL-IP: 93.208.99.17 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 64.12.226.25 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:104722 Archived-At: >> I have problems in understanding the semantics of backquote. Consider >> the following function: ... > Backquote and comma operate at read time. The comma means "Don't quote=20 > this part", so it will be evaluated when the code is run. It doesn't ge= t=20 > evaluated at read time, though, because that would mess up if it has=20 > variable references, e.g. Ah, I always thought, that comma expressions are evaluated at read time. > (defun test (a) `,(+ 1 a)) > > If you looked at this function, it would have to be > > (lambda (a) (+ 1 a)) > > It can't be folded at read time. Yes, I thought this will produce an error. The elisp manual does not make it totally clear, at which time comma expressions are evaluated: Chapter 9.4 Backquote: Backquote constructs allow you to quote a list, but selectively evaluate elements of that list. In the simplest case, it is identical to the special form quote (described in the previous section; see Quoting). For example, these two forms yield identical results: `(a list of (+ 2 3) elements) =3D> (a list of (+ 2 3) elements) '(a list of (+ 2 3) elements) =3D> (a list of (+ 2 3) elements) The special marker =E2=80=98,=E2=80=99 inside of the argument to backqu= ote indicates a value that isn=E2=80=99t constant. The Emacs Lisp evaluator evaluates t= he argument of =E2=80=98,=E2=80=99, and puts the value in the list structu= re: Thanks for clarifying thing up for me. Is there a way to evaluate parts of a defun during read-time or byte-compile-time? Olaf