[TYPES] what is "lexical" about "lexical scoping"?
Kim Bruce
kbbruce47 at gmail.com
Sat Aug 1 11:36:40 EDT 2020
Interestingly, I grew up hearing “static scoping” rather than “lexical”. However, when learning about Smalltalk, started hearing “lexical closure” for what most people these days simply refer to as “closure”.
Wikipedia (for what it is worth) gives the following history for the use of Closure:
"The concept of closures was developed in the 1960s for the mechanical evaluation of expressions in the λ-calculus <https://en.wikipedia.org/wiki/%CE%9B-calculus> and was first fully implemented in 1970 as a language feature in the PAL <https://en.wikipedia.org/wiki/Rpal> programming language to support lexically scoped first-class functions <https://en.wikipedia.org/wiki/First-class_function>.[2] <https://en.wikipedia.org/wiki/Closure_(computer_programming)#cite_note-dat2012-4>:Turner's section 2, note 8 contains his claim about M-expressions
Peter J. Landin <https://en.wikipedia.org/wiki/Peter_J._Landin> defined the term closure in 1964 as having an environment part and a control part as used by his SECD machine <https://en.wikipedia.org/wiki/SECD_machine> for evaluating expressions.[3] <https://en.wikipedia.org/wiki/Closure_(computer_programming)#cite_note-landin-5> Joel Moses <https://en.wikipedia.org/wiki/Joel_Moses> credits Landin with introducing the term closure to refer to a lambda expression <https://en.wikipedia.org/wiki/Anonymous_function> whose open bindings (free variables) have been closed by (or bound in) the lexical environment, resulting in a closed expression, or closure.[4] <https://en.wikipedia.org/wiki/Closure_(computer_programming)#cite_note-6>[5] <https://en.wikipedia.org/wiki/Closure_(computer_programming)#cite_note-7> This usage was subsequently adopted by Sussman <https://en.wikipedia.org/wiki/Gerald_Jay_Sussman> and Steele <https://en.wikipedia.org/wiki/Guy_L._Steele,_Jr.> when they defined Scheme <https://en.wikipedia.org/wiki/Scheme_(programming_language)> in 1975,[6] <https://en.wikipedia.org/wiki/Closure_(computer_programming)#cite_note-8> a lexically scoped variant of LISP <https://en.wikipedia.org/wiki/LISP>, and became widespread.”
I didn’t track down who wrote this passage, but that may offer other hints as to its origin.
Kim Bruce
> On Jul 29, 2020, at 4:06 PM, Norman Ramsey <nr at cs.tufts.edu> wrote:
>
> [ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list ]
>
> This question might be off topic, but I hope not---there is a lot of
> knowledge here. Why is "lexical scoping" called "lexical"?
> I'm used to "lexical" referring to properties that describe how
> concrete syntax is formed---what constitutes a comment, how characters
> are grouped into tokens, and that sort of thing. The "lexical scope"
> used to give meaning to a closure seems more like a property of the
> syntax, not of the lexis.
>
> Is there another meaning of "lexical" that I don't know?
> Or some interesting history?
>
>
> Norman Ramsey
>
>
More information about the Types-list
mailing list