emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cl-byte-compile-compiler-macro


From: Stefan Monnier
Subject: Re: cl-byte-compile-compiler-macro
Date: Sun, 26 Mar 2006 21:07:45 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]