[Top] [All Lists]

Re: I-D ACTION:draft-daboo-sieve-include-03.txt (fwd)

2005-08-26 04:09:12

On Fri, 2005-08-26 at 01:45 +0000, Aaron Stone wrote:
On Thu, Aug 25, 2005, Kjetil Torgrim Homme 
<kjetilho(_at_)ifi(_dot_)uio(_dot_)no> said:

                require "variables";
                set "var" "Hello Kitty";
                if address :localpart "From" "tweety" {
                    set :local "var" "Hello Birdie";
                    set "var" "Tweety says hello";

Are you implying that we're adding both file scope and curly brace scope?

no.  if you don't specify :local, you are changing the global variable,
even if it is invisible.

okay, so you clearly didn't like these semantics.  since the
implementation must track which scope of the variable is active for
referencing, it might as well use that state to decide which scope to
modify during "set".

new suggested text:
4.1. Scope modifier ":local"

        A variable value set with the modifier ":local" will shadow the
global value until
        the script returns.  This value is unchanged across "include"
        Subsequent "set" actions will modify the local value unless a
different scope
        modifier has been specified.

        In contrast with other modifiers for "set", this modifier does
not have any
        particular precedence and it does not change the resulting

with these semantics, ":global" wouldn't be a no-op, but what happens in
this example?

    set "var" "a";
    set :local "var" "b";
    set :global "var" "c";
    # what is ${var} here?
    set "var" "d";
    # and here?

I don't think we need ":global", and it would be confusing to use.
Kjetil T.

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