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

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

Re: lexical-let detail semantics


From: Pascal J. Bourguignon
Subject: Re: lexical-let detail semantics
Date: Tue, 28 Jul 2009 02:48:23 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Daniel Kraft <d@domob.eu> writes:
> Hm...  My main point was whether this is expected behaviour I should
> mimic in my implementation, but I take your response that you would
> prefer to have my implementation behave differently (like what I
> described as my expectation)?

Yes.  


   Personnaly, the closer it's to Common Lisp, the better.  Instead of
   providing a lexical-let, I would provide a (with-cl-semantics ...)
   macro where let, let*, lambda, etc, would behave like in CL, and
   where (declare (special var)) would be needed to get dynamic
   binding like in emacs lisp.  defun* would include an implicit
   with-cl-semantics...


> Do you think this would lead to compatibility problems with existing code?

Be sure to document clearly how it works.  


You may try to "grep" all the .el you can find to see how lexical-let
is used.

# locate -r '\.el*$'> /tmp/els
# wc -l /tmp/els
58179 /tmp/els
# xargs cat < /tmp/els | grep lexical-let | wc -l
3485

That's more uses of lexical-let that I would have expected.  You could
use a function such as my map-sexps (in
http://darcs.informatimago.com/public/emacs/pjb-sources.el
) to find all the occurences of lexical-let and analyse what's in
their bodies.




As you can see from the various comments, it seems the behavior of
lexical-let is changing depending on the version, so it's most
probable that no code depend on this yet.


-- 
__Pascal Bourguignon__


reply via email to

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