Subject: variables: open issue c) NOTIFY compatibility

From: Kjetil Torgrim Homme <[email-masked]>
Date: 02 May 2003 01:46:17 +0200

the text in the draft reads:

  c) the NOTIFY draft has variables, too.  it would be nice if the
     syntax for the two extensions agreed.  a changed NOTIFY can be
     used on its own without the variables extension, the user simply
     won't be able to configure the notification message to include
     different snippets from the message.

the NOTIFY draft has expired, so it's not a particularily important
issue.  the one thing missing from variables is the ability to
truncate string values, which is done in NOTIFY using the syntax
$var[n]$.  in variables, you can simulate it using regex:

  require ["variables", "regex"];
  if header "Subject" :regex "^(.{,200})" {
    set "short" "${1}";
  }

this does seem a bit hackish.  we could instead do something like

  if header "Subject" :matches "*" {
    set :maxlength 200 "short" "${1}";
  }

(aside: it seems to me that optimising the pattern "*" to do no
matching, only set up ${1}, will be worthwhile, this looks to be a
common idiom for all sorts of things...)

the rationale for the truncation operation in NOTIFY is obviously the
ability to send small excerpts of the message through limited mediums
such as SMS or ICQ.  it may be useful for vacation as well.

regular expressions are better suited for doing general substrings
(which I doubt have much general utility anyway), so I won't suggest
an ":offset N".
-- 
Kjetil T.

---

From: Jutta Degener <[email-masked]>
Date: Fri, 2 May 2003 05:30:43 -0700

I liked the rest of your comments, but this one I disagree with:

On Fri, May 02, 2003 at 01:46:17AM +0200, Kjetil Torgrim Homme wrote:
> the one thing missing from variables is the ability to

I'd be happier to just use the existing regex mechanism.

It's what someone familiar with regular expressions would
turn to naturally and already remembers from other languages;
the new mechanism would be unfamiliar to all.

Jutta