emacs-devel
[Top][All Lists]
Advanced

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

Re: Lexical binding


From: Stefan Monnier
Subject: Re: Lexical binding
Date: Mon, 04 Apr 2011 18:34:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> Go through a stage

> (condition-case :fun-body (lambda () ignore)
>   (multi-lambda (x) (quit (x test) test) (error (x test) test)))

Yes, that's my current "best plan" indeed, except it'd be

   (split-binding (test)
     (condition-case :fun-body (lambda () <foo>)
       (quit (lambda (test) test)
       (error (lambda (test) test)))

so it affects as little as possible the rest of the code.  But the above
can interfere with other uses of `test' in <foo> so it needs to be more
precise, maybe something like:
       
   (split-binding (test #:x)
     (condition-case :fun-body (lambda () <foo>)
       (quit (lambda (#:x) test)
       (error (lambda (#:x) test)))

but it's more difficult to make this work with the interpreter.

> or something similar where the byte compiler does the "unused variable"
> check (or a setup for it) during the multi-lambda expansion stage.  What
> kind of form is exactly needed here in order to cater for all such
> situations will require careful thinking.

Yes, that's currently my "best plan", but since it would also be useful
for macros like dolist/loop/pcase, it shouldn't be too hackish and work
well for the interpreted case as well.


        Stefan



reply via email to

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