From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: functions from cl package called at runtime Date: Thu, 19 Jan 2012 20:22:37 +0100 Message-ID: <87r4yvcxaa.fsf@Rainer.invalid> References: <87aa5k25ml.fsf@Rainer.invalid> <87k44n4la9.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnxZY-00037I-HL for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 14:23:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnxZU-000649-33 for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 14:22:56 -0500 Received: from lo.gmane.org ([80.91.229.12]:35749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnxZT-000645-SE for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 14:22:52 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RnxZS-0000yS-Se for emacs-orgmode@gnu.org; Thu, 19 Jan 2012 20:22:50 +0100 Received: from pd9eb374e.dip.t-dialin.net ([217.235.55.78]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Jan 2012 20:22:50 +0100 Received: from Stromeko by pd9eb374e.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Jan 2012 20:22:50 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Eric Schulte 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