help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: flet, cl-flet, cl-letf in 24.3


From: ndemmel
Subject: Re: flet, cl-flet, cl-letf in 24.3
Date: Sun, 21 Apr 2013 02:49:02 -0700 (PDT)
User-agent: G2/1.0

On Sunday, April 21, 2013 9:41:11 AM UTC+2, Drew Adams wrote:
> > it seems that from 24.3 on flet is marked as obsolete, to be 
> 
> > replaced by cl-flet or cl-letf. If you are fine with lexical 
> 
> > scope, cl-flet is your friend. However, I did not find 
> 
> > explicit documentation on what to do when you want to keep 
> 
> > relying on the dynamic scope as with the old flet. Is 
> 
> > (cl-letf (((symbol-function 'foo) #'(lambda (...) ...))) ...) 
> 
> > the suggested method? Does that give always have dynamic 
> 
> > scope? I'm a bit confused.
> 
> 
> 
> If you have read the doc and you feel it does not make things clear, consider
> 
> filing a doc bug: `M-x report-emacs-bug'.

I don't even have emacs 24.3 installed. I'm referring to the documentation 
[1,2,3,4]. Together with the notification

    `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.

as reported here [5], this documentation does not really tell me what to do if 
I want to keep relying on the dynamic scoping of flet. A brief google search 
[6] leads me to believe that 

    (cl-letf (((symbol-function 'foo) #'(lambda (...) ...))) ...) 

is the suggested solution, however I wanted to make sure that is the case.

In any case if that were the sugggested way, it should maybe be added to one of 
the documentation sites [1,2,3,4]. I'd be happy to file a report on that.

Cheers,
Niko


[1] 
http://www.gnu.org/software/emacs/manual/html_node/cl/Function-Bindings.html#index-cl_002dflet-24
[2] 
http://www.gnu.org/software/emacs/manual/html_node/cl/Obsolete-Macros.html#index-flet-173
[3] 
http://www.gnu.org/software/emacs/manual/html_node/cl/Obsolete-Macros.html#index-letf-175
[4] 
http://www.gnu.org/software/emacs/manual/html_node/cl/Modify-Macros.html#index-cl_002dletf-19
[5] https://github.com/moesenle/rosemacs-debs/issues/2
[6] 
https://groups.google.com/forum/#!msg/gnu.emacs.help/eaopyFH5hmY/emHfn-DYZZIJ


reply via email to

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