
The idiot's guide to special variables and lexical closures (2003) [pdf] - lisper
http://www.flownet.com/ron/specials.pdf
======
taeric
I've heard that dynamic scoping was considered faster than lexical for a time.
Anyone know of any papers that would justify such a stance?

~~~
sillysaurus3
I've heard this too. One possible root of this claim is Stallman in regards to
Emacs Lisp. I _think_ he made a post where he said that dynamic scoping was
faster than lexical scoping for elisp (though this was later shown to be
mistaken: [https://emacs.stackexchange.com/questions/2129/why-is-let-
fa...](https://emacs.stackexchange.com/questions/2129/why-is-let-faster-with-
lexical-scope)).

Sorry that I don't have any sources to support this. I can't find the post,
and it may have been secondhand info anyway.

~~~
agumonkey
I thought he meant lexical scope was unfit if not incompatible with an
extensible program. Meaning you had to loosen up the binding to allow for user
code to hook in. Lexical scope made this "impossible" or maybe possible but
required radically different way to program, probably using faux-monadic style
lisp.

------
thesmallestcat
What are the practical differences between special vars in Lisp and dynamic
vars in Clojure? The obvious ones are that `def ^:dynamic` can't be local to a
function, and that Clojure uses a separate form, `binding`, rather than `let`,
to set their values.

~~~
AlainPicard
For me the largest difference is that Clojure carries over all your dynamic
bindings when creating new threads (via 'future') and in lazy seqs, whereas
Common Lisp (typically) does not. I now understand why they choose to do it
this way, but I wish the documentation was much clearer in this regards.

~~~
lisper
The CL standard doesn't deal with threads at all, so different implementations
do things differently. But typically the user can control what the initial
bindings of a thread are through keyword arguments to whatever function spawns
threads.

