[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Questions and remarks on draft-ietf-sieve-include-01.txt
On Tue, 05 May 2009 16:47:11 -0400, Jeffrey Hutzelman <jhutz@xxxxxxx>
> --On Tuesday, May 05, 2009 01:14:09 PM -0700 Aaron Stone
> <aaron@xxxxxxxxxxxxxx> wrote:
>> On Tue, 05 May 2009 15:25:17 -0400, Jeffrey Hutzelman <jhutz@xxxxxxx>
>>> --On Tuesday, May 05, 2009 11:07:59 AM +0200 Stephan Bosch
>>> <stephan@xxxxxxxxxxxx> wrote:
>>>> Also, you completely lifted the global command's placement
>>>> I am not fundamentally opposed to this, but this can make the
>>>> 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
>>>> 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
>>> I would expect that a global command has effect only from the command
>>> the end of the enclosing scope; as a result, a global inside a
>>> has effect only on the conditional code, and never on something
>>> 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
>> 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.
>> 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!
> Hrm. OK, let's make it simple...
> The global command is legal at any point in the script. However, it must
> appear _and be executed_ before any use of the named variable(s).
> Otherwise, the results are undefined.
Or an error is thrown at runtime. I'm not a fan of this idea, but at least
> This means the question of what happens if you use a local variable and
> then call it global is up to the implementation. So is the question of
> what happens if the global command appears in a conditional and that
> is not executed, and then the variable is used.
> I think it gets us all the same implementation simplicity as requiring it
> to be "first", without painting ourselves into the corner of someday
> multiple things that want to be "first".
Yuck, I don't like it when a language doesn't specify something like this,
especially knowing it is probably going to be implemented differently right
from the get-go.