From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: Purpose of dash # in elisp Date: Mon, 9 Nov 2009 18:27:53 +0100 Message-ID: References: <87k4xz7szy.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1257788881 19520 80.91.229.12 (9 Nov 2009 17:48:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Nov 2009 17:48:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Pascal J. Bourguignon" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 09 18:47:54 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N7YLK-0004A9-B3 for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Nov 2009 18:47:54 +0100 Original-Received: from localhost ([127.0.0.1]:42788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7YLJ-0001z9-U1 for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Nov 2009 12:47:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7Y2O-00049f-R2 for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 12:28:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7Y2K-00048j-Rr for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 12:28:20 -0500 Original-Received: from [199.232.76.173] (port=55243 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7Y2K-00048e-Mr for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 12:28:16 -0500 Original-Received: from mail-gx0-f212.google.com ([209.85.217.212]:51456) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7Y2K-0005ds-BE for help-gnu-emacs@gnu.org; Mon, 09 Nov 2009 12:28:16 -0500 Original-Received: by gxk4 with SMTP id 4so467847gxk.8 for ; Mon, 09 Nov 2009 09:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=0ypmRTPdAJi9jtYNFEYE0bW4A8vJWRm1ezhy2ByufvQ=; b=W9H4c8mvtz6ztu1sw+rYl+8xyQ6FPGqFKhNuFB2CzLpm2XeniA8mA67P+XYF2zfUoe LHAKNjd7MOkaXSl4wHWdoI6wsNVPivSgmEqBCfEIDQLVk/oUMzLVM2FA35AXftFkZC2z h71NEkmiIdVGoXTBQQ5/LfrEdJMHoaB6tIWdQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=rkpgMeI7uib5lql1q5CrUbhODXqFC5dnZqfk14rjTTFSm/xRWW3iWSEEnZnTr2cdQI aiwt72fv0QfhZrWo1+0W/xuKKxWZvXWaXRaqHFFiF2K6jHOjzFsmY8HcqkBogCo8SpPO Bs6JITWtRRPjkSjC889fbifL1fbazcWB/QtYQ= Original-Received: by 10.100.82.15 with SMTP id f15mr6701714anb.190.1257787694116; Mon, 09 Nov 2009 09:28:14 -0800 (PST) In-Reply-To: <87k4xz7szy.fsf@galatea.local> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:69630 Archived-At: On Mon, Nov 9, 2009 at 2:00 PM, Pascal J. Bourguignon wrote: > > (first ' #'x) --> function > (first ' =C2=A0'x) --> quote > > It happens that in emacs lisp, function and quote evaluate the same: > they both return their unevaluated argument unchanged. > > However, when compiling, they don't behave the same. =C2=A0function means > that the argument is CODE, while quote says that the argument is DATA. > > (disassemble (byte-compile (lambda () =C2=A0'(lambda (x) (+ x x))))) > produces: > > byte code: > =C2=A0args: nil > 0 =C2=A0 =C2=A0 =C2=A0 constant =C2=A0(lambda (x) (+ x x)) > 1 =C2=A0 =C2=A0 =C2=A0 return > > > > (disassemble (byte-compile (lambda () =C2=A0#'(lambda (x) (+ x x))))) > produces: > > byte code: > =C2=A0args: nil > 0 =C2=A0 =C2=A0 =C2=A0 constant =C2=A0 > =C2=A0 =C2=A0 =C2=A0args: (x) > =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 varref =C2=A0 =C2=A0x > =C2=A0 =C2=A01 =C2=A0 =C2=A0 =C2=A0 dup > =C2=A0 =C2=A02 =C2=A0 =C2=A0 =C2=A0 plus > =C2=A0 =C2=A03 =C2=A0 =C2=A0 =C2=A0 return > > 1 =C2=A0 =C2=A0 =C2=A0 return > > > When the lambda form is quoted, it is considered data, and the > compiler doesn't compile it, but when it's function'ed, it is > considered code, and it is compiled too. Is this a bug, or?