[Top] [All Lists]

Re: the part argument to "date"

2006-10-04 16:30:13

(sorry for the delay getting back to this)

I don't quite like the part argument to "date", since the possible
values are listed explicitly.  making each of them a tagged argument is
easier to express in the grammar, and it avoids the problem of
"${format}" which can fail during run-time.  outline of suggested

The main reason I chose to make this a positional argument is that tagged
arguments are properly optional and I don't think the type of date test should
be allowed to be optional. This is quite unlike the sitations with other tagged
arguments - they have sensible defaults.

4.  Date Test

   Usage:   date [":zone" <time-zone: string>] [COMPARATOR]
                 [MATCH-TYPE] [PART] <header-name: string>
                 <key-list: string-list>

4.2.  Part argument

   The "PART" syntax element is defined as follows:

   Syntax:   ":year" / ":month" / ":day" [...]

   The optional part argument specifies a particular part of the
   resulting date/time value to match against the key-list.  If no part
   argument is given, ":iso8601" is used.  The available parts are:

   [description of each part suitably edited]

Ned, I can write a more specific patch if you like, if you send me your

I'd like to hear from anyone else with an opinion on this. If there's
a consensus to make the change I have no problem, but if its just you any
me who care I'd prefer to stick with my approach.

(BTW, I changed "parameter" to "argument" since that's what the base
spec calls them.)

Noted. I'll change things accordingly.


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