emacs-devel
[Top][All Lists]
Advanced

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

Re: problems with flet on last emacs


From: Pascal J. Bourguignon
Subject: Re: problems with flet on last emacs
Date: Wed, 27 Jun 2012 16:42:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Tassilo Horn <address@hidden> writes:

> Thierry Volpiatto <address@hidden> writes:
>
>> All functions that use flet don't work anymore.
>> The anonymous function defined by the flet is not read.
>> (i.e void function foo)
>
> Oh, yes, that occured to me too.
>
>> I could make it working by restarting my computer, recompiling
>> some libraries, (helm, slime) and it worked.
>
> Not for me.  I've tried to rebuild every elisp package, but the error
> persists.
>
>> When I recompile files, restart Emacs, the problem occur again.
>> I have not this problem on 24.1.
>
> Ditto, currently I'm running the released version without problems.
>
>> Any ideas?
>> If not I will send a bug report.
>
> Please do so.  Here's a recipe:
>
>   1. emacs -Q
>   2. goto *scratch*
>   3. eval
>
>      (require 'cl)
>      (flet ((foo () 1))
>        (foo))
>
>
> Debugger entered--Lisp error: (void-function foo)
>   symbol-function(foo)
>   (let* ((x (cl-function (lambda nil (cl-block foo 1)))) (x (symbol-function 
> (quote foo)))) (unwind-protect (progn (fset (quote foo) x) (foo)) (fset 
> (quote foo) x)))
>   (letf* (((symbol-function (quote foo)) (cl-function (lambda nil (cl-block 
> foo 1))))) (foo))
>   (flet ((foo nil 1)) (foo))
>   eval((flet ((foo nil 1)) (foo)) nil)
>   eval-last-sexp-1(nil)
>   eval-last-sexp(nil)
>   call-interactively(eval-last-sexp nil nil)
>
> The macroexpansion is a bit strange:

Yes, it doesn't seem to be guarding for unfbound symbols…

> (let* ((x (cl-function (lambda nil (cl-block foo 1))))
>        (x (symbol-function (quote foo))))
>   (unwind-protect (progn
>                     (fset (quote foo) x)
>                     (foo))
>     (fset (quote foo) x)))
>
> Two times `x', and those should probably gensyms, anyway...

They probably are.

Try:

(eq 'x (first (first (second (macroexpand '(flet ((foo () 1))
                                              (foo)))))))

and try:

(let ((expansion  (macroexpand '(flet ((foo () 1)) (foo)))))
  (eq (first (first  (second expansion)))
      (first (second (second expansion)))))



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.




reply via email to

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