[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 13 Oct 2013 09:21:33 -0700 (PDT)
> lexical binding allows you to support closures, and with closures
> you can do cool things.
Yes. And they remove "funarg" problems.
> with dynamic binding you can do other cool things (you can let-bind
> a variable, then call a function which calls...and the innermost
> function will reference the value you just bound -- so you can pass
> parameters around without actually having to mention them on every
> function call).
Yes. Which is especially important for a heavily interactive and
customizable program such as Emacs. Emacs users extend and otherwise
modify or adapt the source code, and they do so sometimes on the fly
And that's not only a good thing instead of a bad thing. It is
practically the raison d'etre of Emacs: It is a user Lisp environment
(which offers editor/UI objects such as buffers and windows).
> So each of the styles has their own advantage.
Definitely. Those who imagine that a lexical-only approach, a la
Scheme, would be a better way to go for Emacs are on the wrong track,
> I find that the idea that variables declared specially (e.g. with
> defvar) can be dynamically bound whereas everything else is
> lexically bound by default -- this idea is quite useful. For if
> you want to dynamically bind something to influence another
> function, you need to know which variables that other function uses
> -- and defvar is a good way to document this.
Yes, again. Common Lisp showed how to have lexical and dynamic
scope cohabit the same programming language. Its approach to this is
still a good model to follow.
Now if only Emacs Lisp had good namespace control, like Common-Lisp
Re: DynamicBindingVsLexicalBinding, Phillip Lord, 2013/10/14
- DynamicBindingVsLexicalBinding, Andreas Röhler, 2013/10/12
- Re: DynamicBindingVsLexicalBinding, Dmitry Gutov, 2013/10/12
- RE: DynamicBindingVsLexicalBinding, Drew Adams, 2013/10/12
- Re: DynamicBindingVsLexicalBinding, Andreas Röhler, 2013/10/13
- Re: DynamicBindingVsLexicalBinding, Kai Großjohann, 2013/10/14
- Re: DynamicBindingVsLexicalBinding, Phillip Lord, 2013/10/15
- Re: DynamicBindingVsLexicalBinding, Kai Großjohann, 2013/10/15
- Re: DynamicBindingVsLexicalBinding, Phillip Lord, 2013/10/16
- Message not available
- Re: DynamicBindingVsLexicalBinding, Barry Margolin, 2013/10/16
- Message not available
- Re: DynamicBindingVsLexicalBinding, Rustom Mody, 2013/10/14