5 ms·
i thought old (original) lisp was dynamically scoped?
by andrewcooke 14y ago
i thought old (original) lisp was dynamically scoped?
- philwelch 14y agoYup--I believe it was Scheme that introduced lexical scoping to Lisp, with Common Lisp adopting it later on. Of the commonly used Lisps today, only Emacs Lisp is dynamically scoped.
- andrewcooke 14y agoso the article is misleading, isn't it? it says "Lisp programming language, invented in 1958 by John McCarthy. Lisp pioneered many fundamental computer science concepts, including closures", but closures were first created elsewhere - see http://en.wikipedia.org/wiki/Closure_(computer_science)#History_and_etymology http://en.wikipedia.org/wiki/Closure_(computer_science)#Hist...
- pat_shaughnessy 14y agoOops - I missed that in my research. Yes, I agree this sentence is misleading; I'll update the text later on today. I suppose it's only true that Lisp (specifically Scheme) was the first widely used implementation of closures.
- andrewcooke 14y agoyes, i think that would be a better way of phrasing it. it's weird how old scheme is (1975 - 37 years old).
- Zak 14y agoOf the commonly used Lisps today, only Emacs Lisp is dynamically scoped. That's not quite accurate. Common Lisp and Clojure are both lexically and dynamically scoped. In CL, things created with def* (defun, defparameter, defvar, etc...) are dynamic, while function arguments and things created with let are lexical[0]. In recent versions of Clojure, it's necessary to explicitly make a symbol dynamic with metadata. [0] This is probably not entirely correct or complete, but should get across the general idea.