Closed skeeto closed 10 years ago
Definitely. Feel free to turn this into a PR.
On Friday, September 5, 2014, Christopher Wellons notifications@github.com wrote:
Lexical scope was introduced in Emacs 24. All new Emacs Lisp code should begin with a local variable statement setting the file to lexical scope.
;;; foo.el --- Foo the bars -- lexical-binding: t; --
Lexical scope has safer and cleaner semantics (local assignments aren't visible in callees, scopes are predictable at compile time), allows for additional checks by the compiler (free variables must be declared as global variables, variables aren't just opaque symbols), and has better performance (stack-oriented storage). All new code should take full advantage of it. Global variables are still dynamic, so there are no disadvantages to using lexical scope.
— Reply to this email directly or view it on GitHub https://github.com/bbatsov/emacs-lisp-style-guide/issues/11.
Lexical scope was introduced in Emacs 24. All new Emacs Lisp code should begin with a local variable statement setting the file to lexical scope.
Lexical scope has safer and cleaner semantics (local assignments aren't visible in callees, scopes are predictable at compile time), allows for additional checks by the compiler (free variables must be declared as global variables, variables aren't just opaque symbols), and has better performance (stack-oriented storage). All new code should take full advantage of it. Global variables are still dynamic, so there are no disadvantages to using lexical scope.