From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: What does byte-compile a variable containing a lambda do? Date: Wed, 03 Jun 2009 10:45:02 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1244018720 28557 80.91.229.12 (3 Jun 2009 08:45:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jun 2009 08:45:20 +0000 (UTC) Cc: Emacs-Devel devel To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 03 10:45:17 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MBm60-0005os-Ft for ged-emacs-devel@m.gmane.org; Wed, 03 Jun 2009 10:45:16 +0200 Original-Received: from localhost ([127.0.0.1]:58524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBm5z-0002yV-Qg for ged-emacs-devel@m.gmane.org; Wed, 03 Jun 2009 04:45:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MBm5u-0002yI-KC for emacs-devel@gnu.org; Wed, 03 Jun 2009 04:45:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MBm5q-0002xk-23 for emacs-devel@gnu.org; Wed, 03 Jun 2009 04:45:10 -0400 Original-Received: from [199.232.76.173] (port=41271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MBm5p-0002xh-U6 for emacs-devel@gnu.org; Wed, 03 Jun 2009 04:45:05 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:35696) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MBm5p-0007uL-Hr for emacs-devel@gnu.org; Wed, 03 Jun 2009 04:45:05 -0400 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id CA85C1C00230; Wed, 3 Jun 2009 10:45:04 +0200 (CEST) Original-Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id BA3C89032D; Wed, 3 Jun 2009 10:45:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id H4muzxZivu4k; Wed, 3 Jun 2009 10:45:03 +0200 (CEST) Original-Received: from igel.home (DSL01.83.171.189.214.ip-pool.NEFkom.net [83.171.189.214]) by mail.mnet-online.de (Postfix) with ESMTP; Wed, 3 Jun 2009 10:45:03 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id 078F910DC7B; Wed, 3 Jun 2009 10:45:02 +0200 (CEST) X-Yow: I'm having an emotional outburst!! In-Reply-To: (Lennart Borgman's message of "Wed, 3 Jun 2009 04:00:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111308 Archived-At: Lennart Borgman writes: > The help text for byte-compile says > > byte-compile is a compiled Lisp function in `bytecomp.el'. > > (byte-compile form) > > If form is a symbol, byte-compile its function definition. > If form is a lambda or a macro, byte-compile it as a function. > > I do not understand the last sentence. What happens? If a variable > contains a lambda and you do > > (byte-compile VAR-WITH-LAMBDA) Since byte-compile is a regular function, it can only see the value it gets passed. So unless you pass it a symbol (first case) it can only return the byte compiled form without side effect. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."