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

Re: variables: open issue a) date variables

2003-05-03 08:11:59

On Saturday 03 May 2003 02:06, ned(_dot_)freed(_at_)mrochek(_dot_)com wrote:
<snip>
I have no problem with defining a magic variable namespace. In fact
in some way I'd prefer it. That being said, however, I have a big
problem with defining it and not using it in the same document. All
too often this leads to issues being left open and problems not being
spotted until too late.
<snip>

We'd have the date and imapflags (and notify) extensions to go along
with variables. The variables draft also defines the special
num-variable "system variables" for the regex extension and :matches.

I'd somewhat prefer to use $ for the prefix, but it works either way.
<snip>

I don't like $ being the prefix since it's also the variable special
character. "${$year}" smells like resolving references (or pointers if
you're C) to a perl programmer. Also, the variables draft mentions this
example:

That's sufficient reason, I guess. I do note, however, that nobody else is
jumping in to support this prefix idea. I'm ambivalent about it myself.

        "${company}" => "ACME"
        "${President, ${Company} Inc.}"
                     => "${President, ACME Inc.}"

Which makes (if kept, I'm not sure it should be, personally, I think it
should give an error) the interpretation of

set "year" "2000";
fileinto "archive.${$year}"

ambiguous (could either file into "archive.${2000}" or "archive.2003" if
2003 was the current year).

I don't see any ambiguity here. This is clearly a reference to $year, not
year, and the result will be 2003. The brackets are mandatory in variable
references, not optional.

                                Ned