Bastien Guerry <b...@gnu.org> writes: > 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.
Not at all. Lexical binding is still the way to go. If you need dynamic binding, use a global variable, e.g., a defvar, so at least this is explicit. > 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. This is really not a good idea. Firstly, if lexical-binding is nil, no code can use it (obviously). You will not get a warning saying "Hey, your code would really benefit from lexical binding", either. You really don't want to ponder about it at every non-trivial change you make in the file. Secondly, when active, the compiler can reason (a bit) about the code and report more informative errors. The code is more readable, and therefore easier to debug, too. There is absolutely no drawback in using lexical binding. Since Emacs 24.1, it _is_ the default for Elisp: every Elisp file created activates it, the other binding being for compatibility with older libraries. Please, pretty please, don't suggest it is different. Regards,