ietf-mta-filters
[Top] [All Lists]

Re: scoping and variables yet again

2005-09-26 10:35:58

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 :-).  the usage
of the word "script" to mean a single fragment is consistent with other
Sieve documents.  e.g., an extension needs to be declared via "require"
in each script which uses it according to the base spec.

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.

what is "global scope within a script"?  does this mean included scripts
are affected?  what is a "script"?

Ok, I see your point.

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.

 it may be unfortunate that we have
no established term for the collection of scripts into a bigger whole,
but as it is, I think "script" _is_ a single part (or file, or
fragment).

<Prev in Thread] Current Thread [Next in Thread>