From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: cl-byte-compile-compiler-macro Date: Sun, 26 Mar 2006 21:07:45 -0500 Message-ID: <87ek0olk4t.fsf-monnier+emacs@gnu.org> References: <1t3bh8soqw.fsf@fencepost.gnu.org> <2wacbf6xt1.fsf@fencepost.gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143488578 23481 80.91.229.2 (27 Mar 2006 19:42:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Mar 2006 19:42:58 +0000 (UTC) Cc: rgm@gnu.org, "Kim F. Storm" , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 27 21:42:56 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FNxbx-0000yt-1e for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2006 21:42:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNxbw-00014f-Cp for ged-emacs-devel@m.gmane.org; Mon, 27 Mar 2006 14:42:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FNh93-0006na-P6 for emacs-devel@gnu.org; Sun, 26 Mar 2006 21:07:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FNh93-0006nO-05 for emacs-devel@gnu.org; Sun, 26 Mar 2006 21:07:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNh92-0006nL-T7 for emacs-devel@gnu.org; Sun, 26 Mar 2006 21:07:48 -0500 Original-Received: from [209.226.175.54] (helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FNhAP-0008VZ-TT; Sun, 26 Mar 2006 21:09:14 -0500 Original-Received: from alfajor ([70.55.141.48]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060327020745.HLLE20622.tomts10-srv.bellnexxia.net@alfajor>; Sun, 26 Mar 2006 21:07:45 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id C9DF3D734A; Sun, 26 Mar 2006 21:07:45 -0500 (EST) Original-To: Andreas Schwab In-Reply-To: (Andreas Schwab's message of "Sun, 26 Mar 2006 16:10:28 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:52110 Archived-At: >> However, grepping for cl-byte-compile-compiler-macro in all *.elc >> files yields this result: >> >> I agree it is suspicious. On the other hand, it occurs to me that >> maybe it is not a bug--maybe this is how defstruct accessor macros >> are implemented. Could that be it? > The symbol is only used as a constant. AFAIK the symbol is a used as a symbol property. It tells the byte-compiler that a function call to the function bound to the corresponding symbol can be optimized in some cases and that the way to optimize it to to pass it to the cl-byte-compile-compiler-macro property value (it's a so-called "compiler macro"). It's used for example to turn a call to (list* a b c) into (cons a (cons b c)), i.e. in this case a mix of inlining and unrolling. And yes, it's quite likely that defstruct accessors define compiler macros (I believe that CL's defsubst* are implemented using this same mechanism). Stefan