[Top] [All Lists]

Re: Questions and remarks on draft-ietf-sieve-include-01.txt

2009-05-05 16:32:09

On Tue, 05 May 2009 15:25:17 -0400, Jeffrey Hutzelman <jhutz(_at_)cmu(_dot_)edu>
--On Tuesday, May 05, 2009 11:07:59 AM +0200 Stephan Bosch 
<stephan(_at_)rename-it(_dot_)nl> wrote:

Also, you completely lifted the global command's placement requirements.
I am not fundamentally opposed to this, but this can make the inclusion
of a global variable conditional, i.e. inside an if statement. Until I
actually implement this I won't really know for sure whether there will
be implementation issues.

And if the possibility for a conditional global command is desired, I
would expect an explicit mention of this possibility somewhere in the
command explanation. Now it could come to a surprise to the more naive
implementer. This also implies that a global variable is not included
into the local scope until after the first global command that specifies

I would expect that a global command has effect only from the command to 
the end of the enclosing scope; as a result, a global inside a
has effect only on the conditional code, and never on something occurring

after the conditional, regardless of whether the conditional is taken.

Would require variable scoping rules that follow the curly braces, but
we're doing it PHP / Python style in Sieve.

Alternately, a global command could be defined to apply to the entire
regardless of where it occurs.

That presumes pre-parsing the script, which I don't want to sneakily make a
requirement of interpreters.

I went with this approach: the variable is local to the immediate script
until it is called global at some point later in the script. I flipped a
coin, and decided the local value would then overwrite the global value. I
could as easily see it go the other way, though. I can't think of any
particularly good examples from other languages that might apply here.
Feedback appreciated!