I explore in this file new terminology for explaining scopes of variables. Ever since FORTRAN computer language systems allowed programmers to choose identifiers to denote things in their programs. I speak here of the flexibility that perhaps Algol introduced in letting one identifier denote different things in different parts of the program. In Algol one must declare each identifier textually before using it otherwise. In different parts of the program the same identifier can be reused but each use must be uniquely connected with some such declaration. Here we call such an introduction, and subsequent related uses, a ‘role’ here for for will need the term often.
We explore how the rules by which a mention of an identifier is firmly connected with a declaration—i.e. spell out the syntactic rules controlling a role. I will italicize “declaration” when I use it in the technical OCaml sense. Perhaps there is no confusion to be avoided.
I attempt next to capture these extra rules in the new idiom.
The typedef includes optional type-params and the role of each such type-params is limited to that typedef. Each type-param must appear just once among the type-params of the typedef and may occur 0 or more times within the type-information of that typedef.
A sequence of specificationss introduces and contains the role of both value-names and typeconstr-names.
I like the role terminology so far—now for new ground.
This seems to explain introductions of tag-names. I rely mostly on experiments to understand. See this.
The syntactic category typexpr occurs in many place in the BNF. We must explore to see if some of these introduce scopes.