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

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

bug#11407: 24.0.96; Doc for lexical binding in Elisp manual


From: Drew Adams
Subject: bug#11407: 24.0.96; Doc for lexical binding in Elisp manual
Date: Fri, 4 May 2012 14:08:03 -0700

> > > (defun foo (arg)
> > >   (lexical-let ((beta  (something)))
> > >     #'(lambda () (alpha arg beta))))
> >  
> > > Does the closure here treat ARG as lexically bound by the 
> > > `defun', or is ARG a dynamically bound free var in the lambda?
> > > I believe the answer is that the value of ARG encapsulated
> > > in the closure is the value that is passed as argument to foo.
> > 
> > The behavior is largely the result of some accidental 
> > design decisions taken years ago in the implementation of
> > lexical-let, and I have no intention to document the result.
> 
> Surely, if `lexical-let' is to be used by users (see above), 
> they deserve a description of its behavior in this regard.
> The behavior is, as I think you're agreeing, not obvious.

Not to mention the additional reason that people converting code that uses
`lexical-let' to use file-wide lexical behavior instead might in some cases need
to be aware of this idiosyncratic behavior, to convert properly.






reply via email to

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