emacs-devel
[Top][All Lists]
Advanced

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

Re: Lexical bindings (was Re: table.el)


From: Miles Bader
Subject: Re: Lexical bindings (was Re: table.el)
Date: 03 Dec 2001 22:07:26 +0900

address@hidden (Kim F. Storm) writes:
> Since I assume that there is no existing emacs lisp code which
> depends on lexical scope, I don't see why we have to make such
> dramatic - and complicated - changes to the semantics of `let'.

Because it's the most natural way to extend elisp that respects how it
is actually used.

Here's a hint:  don't think about the _mechanism_, think about the
_intent_; that's what people do when they're writing a program.

In elisp, like other dynamically-scoped lisps, `let' is used for two
basic purposes:  (1) to bind "local" variables, and (2) to bind
variables for communicating with other functions.  Though these use the
same mechanism in such lisps, I believe that they are two conceptually
different actions.  In elisp (and common-lisp), they are both done using
the same special form.

You may think this is ugly, but it's the way elisp (and common-lisp)
works, and people are used to it.  I claim that the mechanism I'm using
(which is also used by common-lisp, so it's hardly somethhing radical)
more accurately reflects the way people use let in real life -- even
more so than dynamically bound elisp.

> Wouldn't it be much simpler - and easier to understand - simply to add
> lexically scoped alternatives to `let' and `let*', e.g. named `local'
> and `local*', and then let `let' keep its current semantics?

I'm not trying to create a new super language, I'm trying to add
lexical binding to elisp.  In elisp, binding local variables is done
with `let'.

When I write a program, I don't want binding local variables to be a
`special' action, I want it to be the _default_ (after all, probably
99.9% of variables bound are local variables), and I want to use the
same binding form that every other lisp uses to bind local variables --
`let'.

-Miles
-- 
Yo mama's so fat when she gets on an elevator it HAS to go down.



reply via email to

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