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

selinger at mathstat.dal.ca selinger at mathstat.dal.ca
Sat Aug 1 11:54:06 EDT 2020


Michael Greenberg wrote:
> 
> I think "lexical" here (and in "lexical scoping") is meant to mean
> "pertaining to the [bracketing structure of the] written concrete
> syntax", even though that's not the dictionary meaning of the word
> "lexical" (as you point out). It would make more sense to say
> "syntactically enclosed", but... here we are.

Michael's reply prompted me to look up the actual dictionary meaning
of the word "lexical", and I found two meanings (from
Merriam-Webster). The first is:

1. "of or relating to words or the vocabulary of a language as
distinguished from its grammar and construction"

So that would be the meaning appropriate for phrases like "lexical
analysis". But there's also:

2. "of or relating to a lexicon or to lexicography"

That is the meaning I would associate with the phrase "lexical
scoping". As I understand lexical scoping, a scope is a dictionary or
lexicon, basically a map from identifiers of the concrete syntax to
binding sites of the abstract syntax. This dictionary is updated
during parsing. Perhaps "lexical" refers to the fact that the meaning
of the identifier is looked up in this (static) lexicon, as opposed to
determined dynamically at runtime?

-- Peter


More information about the Types-list mailing list