On Wed, 2005-10-19 at 13:21 +0200, Michael Haardt wrote:
On Tue, Oct 18, 2005 at 11:15:53PM +0200, Kjetil Torgrim Homme wrote:
why is putting them in the method spec bad? adding syntax elements does
mean we need an extension for each method, e.g., require "notify-sms",
but I don't think that is a bad thing at all. it means the user will
have a way of knowing which notification methods are supported,
something he can't do today.
Putting options in the method spec is bad, because basically it
introduces overloading. Suddenly, a parser could not detect
errors on unknown options when parsing the notify arguments, but
first must parse all options, and then semantic analysis has to
find out if there is a signature for them.
Say you have two methods:
"sms", which offers the option "route" to specify the route
"mailto", which offers the option "from" to specify the sender
What's the error message on:
notify :from "sender(_at_)example(_dot_)com" :method "sms:0123456789" ;
It is: No matching option signature. Now that's an error users are
really going to hate.
no, the argument to :method is a structured value, so we can trivially
know that if :method "foo:whatever" exists without a require
"notify-foo", it's an error. this is similar to the requirements for
comparator.
--
Kjetil T.