emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] functions from cl package called at runtime


From: Achim Gratz
Subject: Re: [O] functions from cl package called at runtime
Date: Thu, 19 Jan 2012 20:22:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Eric Schulte <address@hidden> writes:
> Is there a convention for which macros from cl-macs are allowable and
> which are forbidden?

You might want to ask on the Emacs list, but my understanding is that no
Emacs core packages should depend on cl _at runtime_, but it is OK to
use the cl package during byte-compilation.

>  For example `flet' is used extensively throughout
> the Org-mode code base.  Is the convention that macros are allowable
> while functions are not?

A macro would typically be expanded at compile time, so that would be
OK.  AFAIK gensym is a function, not a macro.  The calls to gensym that
the byte-compiler complains about are expanded at runtime because they
are themselves inside a macro definition.

> Also, while intersection below is a function defined in cl-seq, the use
> of `intersection' in ob.el refers to a local function and not the cl-seq
> function, so it should be fine.

The byte-compiler thinks otherwise, so I'd check that assumption
again... but it might be a good idea to disambiguate the name with a
prefix anyway.  I've just tested the latter approach (renaming
intersection to ob-intersection) and it does work, so somehow the
byte-compiler doesn't quite get what is going on in the flet expansion
when the symbol is already present via the cl package.

I've just looked at the comments in cl-macs.el and it seems that flet
should be used with care anyway, since it is not quite doing what it is
supposed to do...


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra




reply via email to

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