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

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

Re: top-level lexical bindings


From: Stefan Monnier
Subject: Re: top-level lexical bindings
Date: Mon, 27 Jan 2014 18:45:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> When Emacs 24.1 was released and lexical bindings introduced, there was
> apparently a problem with top-level lexical variables inside defuns:

> Instead of writing

> ```
> (let ((x))
>   (defun foo ()
>     (setq x ...)))
> ```

> one had to write:

> ```
> (let ((x))
>   (defalias 'foo (lambda ()
>                    (setq x ...))))
> ```

> I was wondering if this issue has been resolved yet. I can't find
> anything about it in the NEWS file, so I'm guessing not?

Yes, it's been resolved.  In 24.3 `defun' is a macro that expands to the
`defalias' form.


        Stefan




reply via email to

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