[TYPES] what is "lexical" about "lexical scoping"?

Jacob Thomas Errington jacob.errington at mail.mcgill.ca
Fri Jul 31 08:56:42 EDT 2020


Lexical scoping is also called static scoping. I believe it's called
"lexical" because the variables in scope at a given point is
determined by that point's position in the program text. In other
words, the scoping is determined by the syntax. This is in contrast
with dynamic scoping, where the set of variables in scope is
determined by the execution of the program.

Jake

On Wed, Jul 29, 2020 at 07:06:52PM -0400, Norman Ramsey 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
>
>

--
Jacob Thomas Errington
W: https://jerrington.me/
#: (514) 503-3100


More information about the Types-list mailing list