05/02/11 14:05:53 .net
別に有利じゃないよ。lexical scope の言語で dynamic binding を使いたい
ならfluid-let みたいなマクロを用意しとけばいいだけだし。
Emacs Lisp が dynamic scope なのは、インタラクティブな環境ではそれが有
利だからじゃなくて、デザインされた当時、Lisp のような言語ではその方が
効率的だと思われていたからでしかない。現在では byte-opt.el にもあるよ
うにすでに足枷でしかないんだけど、rms によると既存のコードとの互換性の
方が重要なんだそうな。
URLリンク(www.paulgraham.com)
it was a widely held opinion at the time that "lexical scope is
interesting, *theoretically*, but it's inefficient to implement;
dynamic scope is the fast choice."
...
I asked RMS when he was implementing emacs lisp why it was dynamically
scoped and his exact reply was that lexical scope was too
inefficient. So my point here is that even to people who were experts
in the area of lisp implementation, in 1982 (and for years afterward,
actually), Scheme was a radical, not-at-all-accepted notion.
URLリンク(lists.gnu.org)
I am not interested in changing Emacs Lisp to be lexically scoped. It
would be a major incompatible change. We want to make Emacs support
Scheme, and one byproduct of that will be the availability of lexical
scoping. But the Emacs Lisp language will always use dynamic scope.