Subject: Re: scoping and variables yet again

From: Kjetil Torgrim Homme <[email-masked]>
Date: Mon, 03 Oct 2005 17:46:12 +0200

On Mon, 2005-09-26 at 18:20 +0100, Alexey Melnikov wrote:
> Kjetil Torgrim Homme wrote:
> >my suggestion is (text A), a complete reversal of behaviour:
> >
> >    Variables are only visible to the currently running script.
> >
> >the possibility of a different extension allowing a different scope is
> >implicit -- everything not forbidden can be overridden :-).  [...]
> >
> >Aaron Stone's suggestion is similar in effect, I think (text B):
> >
> >        All variables have global scope within a script. Future
> >        specifications may allow for a script to be composed of more
> >        than one file [part?], or for running more than one script per
> >        message [delivery?]. Such specifications may provide for
> >        different variable scoping rules.
> >
> >it attempts to be more explicit, but I think it muddies more than it
> >clarifies, to be honest.
>
> How about replacing the first sentence of B with your proposal A.
> 
> The rest of the paragraph is trying to say that there would be other 
> specification with different scoping rules, or additional operators that 
> can declare a variable global for other scripts/imported from another 
> script.

okay, I suggest:

        Variables are only visible to the currently running script.
        Note: Future extensions may provide different scoping rules for
        variables.

by omitting the middle sentence, we avoid getting into dangling
definitions (what's a "file"), and we also don't rule out the
possibility of a block local scope.
-- 
Kjetil T.

---

From: Alexey Melnikov <[email-masked]>
Date: Mon, 03 Oct 2005 16:49:13 +0100

>possibility of a block local scope.
Ok, sounds like a reasonable compromise.