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

Re: variables: open issue a) date variables

2003-05-03 15:57:13

[Marc Mutz]:

  So you say that
    set "year" "${year} AD";
  is possible, but that
    set "imapflags" "${imapflags} \\Seen";
  is too magic and writing to system variables should be disallowed?

I don't like that writing to some variables has side effects.  it
seems to me that you want this SET to actually change the global IMAP
flags?  I want to require an explicit action to do so.  side effects
must be kept to a minimum.

  I agree with the latter, but not with the former. I don't see the 
  usefulness of
    set "year" "${year} AD";

me neither :-)

perhaps if you want to change ${year} to use the Mayan calendar?
(that'd be fun -- lots of regexp matching should do it :-)

  since
  1. It can lead to hard-to-find bugs if, in a large script, you 
     alter the value of "year" and way down the script test against
     ${year}.

don't do that then.

my point is that the user can use ${year} himself if he doesn't use
SETDATE.  e.g.,

    if header :matches "Date" "*, * * * *:*:* *" {
        set "day" "${2}";
        set "year" "${4}";
        # ...
    }

this is particularily important since SETDATE is part of the
"variables" extension, but I don't like to add "reserved variables"
when we don't need to, and I'm not convinced we do.

  and more importantly,
  2. What does the above solve that can't be solved by
       set "myyear" "${year} AD";

nothing.

-- 
Kjetil T.