w7cook / AoPL

A book on programming languages, using Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The definition of scope is too narrow.

reflectionalist opened this issue · comments

I am not satisfied with the definition of scope in Section 2.3.3. What you give there is more like a definition of lexical/static scope. Using this definition, there is no space for the debate between static scoping and dynamic scoping. But this debate is a very important issue concerning language design. In particular, it is necessary to show how dynamic scoping does something wrong to emphasize how static scoping does it right.

In my opinion, scope should be treated as a term describing run-time aspects of variables because it concerns bindings of variables when a program is running. Lexical/static scoping seems lexical/static because it is so defined to align to the lexical or static structure of the program.

It seems I have taken the word dynamic in dynamic scope literally and confused the term scope with extent.