[Top] [All Lists]

Re: Sieve Readability Suggestions

1997-04-30 08:48:36
I agree with this; it'll make indentation prettier, but I can see it as
being a problem.  I opted for SMTP strings in part because mail and some
similar programs cope with them; while this is an awkward solution, it makes
the parser easier.  But if the theory is that novices won't write many
scripts, I can cope with C-style strings.  (The "reply" feature is one
that probably should be kind of difficult to use.)  If we don't use
backslashes above, we can use backslashes here, although I'm partial to
ANSI C-style string composition ("this is one" " long string").

The ANSI C way seems reasonable enough to me...

However, there is an alternative if you want to keep the SMTP style stuff.
Specifically, instead of making the message send operator special, you add
a lexcical component to the language that is equivalent to a string. For

blah blah blah message text The text of the message starts
after the text token and continues until an SMTP-style end of string is
seen. The entire text object is lexically equivalent to having the same
thing in quotes; it does not imply any sort of operation. Here text is being
used as an argument to the message operator.
blah blah blah

I would also recommend that you make the following legal:

blah blah blah message "this is a one liner" blah blah blah

This way we could add, say, a mime_message operator later on:

blah blah blah mime_message text "Content-type: image/gif
Content-transfer-encoding: base64

--base64 encoded stuff here--
blah blah blah