Re:How Ruby Borrowed a Decades Old Idea From Lisp
by philwelch on Tuesday September 18, 2012 @12:42PM
(#4539051)
Yup--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.
[ Parent
| on HN ]
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by Zak on Tuesday September 18, 2012 @01:43PM
(#4539461)
Of 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.
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by andrewcooke on Tuesday September 18, 2012 @12:52PM
(#4539132)
so 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)#Hist...
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by pat_shaughnessy on Tuesday September 18, 2012 @03:07PM
(#4539928)
Oops - 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.
Re:How Ruby Borrowed a Decades Old Idea From Lisp
by andrewcooke on Tuesday September 18, 2012 @04:59PM
(#4540474)
yes, i think that would be a better way of phrasing it. it's weird how old scheme is (1975 - 37 years old).