[Top][All Lists]

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

Re: problems with flet on last emacs

From: Stefan Monnier
Subject: Re: problems with flet on last emacs
Date: Fri, 09 Nov 2012 14:23:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

> Is `flet` (not cl-flet) going to be available in future emacsen?

Depends how "future" those emacsen are.  And also depends on how the
future turns out to be.  In my ideal future, those CL thingies not
prefixed by "cl-" will indeed disappear.  But given the enormous amount
of packages out there that use (require 'cl), this future is still
many years away.

And when cl.el gets dropped from Emacs, it'll probably be moved to GNU
ELPA.  Similarly, a forward-compatiblity cl-lib.el may appear on ELPA
(hopefully earlier) for Emacs<24.3, so that packages can move to cl-lib
without restricting themselves to Emacs-24.3 and up.

> Or should I start future-proofing my code with compatibility macros?

You could help write the cl-lib.el forward-compatibility package.

> What about `labels` and other common-lisp macros and defuns?

`flet' is special in that it was a weird beast using an ugly
implementation.  So while all of cl.el will be marked obsolete (i.e. not
yet removed) at some point (maybe for Emacs-25?), `flet' (along with
a couple others) is already marked obsolete.

Of course, I recommend you use cl-flet, cl-flet*, or cl-labels, but if
you don't want to limit yourself to emacs>24.2 you can use
`labels' instead.

These have the advantage that the function definitions are lexically
scoped, contrary to `flet' which ends up having the same kind of
problems as `defadvice' but without saying so.


reply via email to

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