[e-lang] "Scope" or "Environment"? Your observations wanted
toby.murray at comlab.ox.ac.uk
Mon Aug 11 00:04:37 CDT 2008
On Sun, 2008-08-10 at 20:25 -0400, Kevin Reid wrote:
> I've been arguing (to MarkM) that the thing which E-on-Java calls
> Scope should be called Environment, or Env.
I'd come to the same conclusion.
> What is now called Scope is a collection of nouns (variable names)
> associated with slots providing the values for those nouns.
> I have said that a "scope" actually refers to the textual region in
> which a variable is visible; i.e. it is static, and a property of the
> program, whereas "environment" refers to the runtime state, what the
> variables in some scope are bound to in the execution under
Scope is a property of a variable or noun, to use E's terminology.
Environment is a property of an interpretation of a program fragment.
> Am I wrong?
> Is there common usage that disagrees with this, and is not just casual
Proper common usage of "environment" and "scope" are as you describe.
However, the abuse of the term "scope" to mean "environment" doesn't
appear to be uncommon, nor to create confusion when it occurs.
> Are there other reasons against (or for) this renaming?
Convention (that is, internal E convention.)
> (MarkM dislikes the name "environment" because it is so long; so I
> propose to use the shorter word "env" at least in verb names.)
I also prefer the word "environment" from a purely technical standpoint
of conveying ideas to new users by using the most familiar and
appropriate terminology. However, "safeEnvironment" does seem a bit of a
mouthful. Env might be the only compromise, unless there is a common
synonym for "environment" in common usage amongst PL folks.
More information about the e-lang