[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical binding -- do we really need it?
From: |
Kim F. Storm |
Subject: |
Re: Lexical binding -- do we really need it? |
Date: |
07 Dec 2001 16:36:17 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Miles Bader <address@hidden> writes:
> address@hidden (Kim F. Storm) writes:
> > So why go through all the hazzle of adding lexical binding - just to
> > make a 1% difference ? Sounds pretty academic to me!
>
> _I_ want it because I want to be able to use let-binding freely, without
> the overhead of dynamic binding (it's not horribly large, but it does
> exist, and for code that must be very fast, it can make a difference).
> Lexical binding is in many cases basically free (e.g., has no additional
> cost over not binding at all). As it is, I always end up thinking a
> little before I binding something -- `do I really need to make this
> binding?' -- which is stupid.
>
I agree with everything you say here, although I usually ignore the
overhead of using let-bindings ... so I already use them freely :-)
> It also gives the compiler greater latitude to do optimizations that are
> currently impossible because a binding _might_ escape (even though every
> human programmer knows it won't, or at least shouldn't).
>
Once again, I agree this is desireable.
> You might try reading the archives of this list, BTW, where all this has
> been discussed before -- indeed, I rather wish you had raised these
> objections then, _before_ I started implementing all this!!!
>
Me too :-)
> Please keep in mind that my implementation is very simple (I've already
> passed it by Richard), and as far as I can tell, the only `hazzle' is in
> your mind...
>
Ouch!
Still, I don't see why your arguments justify changing the semantics
of `let' (with all the derived changes) rather than introducing a new
`llet' for lexical binding.
Of course, you wouldn't be able to use `let' freely, but typing that
extra `l' in `llet' seems to be a small price to pay for freedom :-)
Anyway, since Richard has already sanctioned the implementation, I'll
rest my case.
- Lexical binding -- do we really need it?, Kim F. Storm, 2001/12/07
- Re: Lexical binding -- do we really need it?, Miles Bader, 2001/12/07
- Re: Lexical binding -- do we really need it?,
Kim F. Storm <=
- Re: Lexical binding -- do we really need it?, Miles Bader, 2001/12/07
- Re: Lexical binding -- do we really need it?, Kim F. Storm, 2001/12/07
- Re: Lexical binding -- do we really need it?, Stefan Monnier, 2001/12/07
- Re: Lexical binding -- do we really need it?, Miles Bader, 2001/12/07
- Re: Lexical binding -- do we really need it?, Stefan Monnier, 2001/12/07
- Re: Lexical binding -- do we really need it?, Miles Bader, 2001/12/07
- Re: Lexical binding -- do we really need it?, Miles Bader, 2001/12/07
- Re: Lexical binding -- do we really need it?, Kai Großjohann, 2001/12/08
- Re: Lexical binding -- do we really need it?, Richard Stallman, 2001/12/08
- Re: Lexical binding -- do we really need it?, Colin Walters, 2001/12/09