Hi Nicolas, Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
> Bastien Guerry <b...@gnu.org> writes: > >> Still: when it is not used, why adding it? > > We are not adding it since it is in the file by default; you removed > it :) I guess it is in the file by default because the odds are good that lexical scoping will be actually used. > This is an odd question, however. The thing is: how is Emacs-lisp > scoping, dynamic or lexical? We ought not consider it to be both > throughout the code base (even though one file still uses dynamic > scoping) as it is just confusing for developers. Since lexical scoping > prevents a whole class of (vicious) bugs, it is the most common type of > scoping among modern languages, by large. As of Emacs 24.1, let's just > consider Elisp to be lexically scoped. I agree it's good to have lexical scoping, but I don't consider Elisp to be lexical scopped -- I consider Elisp to let the user pick up the constraints he wants, with dynamic binding still being the default. > In a nutshell, "-*- lexical-binding:t ; -*-" ought to be a mandatory > cookie in every Elisp file. Maybe lexical binding will be the default behavior one day, but in the meantime, I would suggest to use "-*- lexical-binding:t ; -*-" only if lexical binding is actually used in the file. Best, -- Bastien