principle of least surprise

Thomas Lindgren thomasl_erlang@REDACTED
Tue Nov 22 15:25:59 CET 2005

--- mbj@REDACTED wrote:

> Nick Linker <xlcr@REDACTED> wrote:
> > 
> > >Better than nothing of course, but wouldn't it be
> great to fix this
> > >mis-feature and make the language better?
> > >  
> > >
> > Hm, what, in your opinion, about the possibility
> to be an arbitrary 
> > function (returning true or false, of course) in
> guards? Will it make 
> > the language better?
> Maybe I should have added "and more consistent". 
> Anyway I think
> arbitrary functions in guards is an orthogonal
> question.  Personally I
> think it would be nice but it's not that big deal.

Well, you seem to want to introduce abstractions into
your guards by way of macros (?is_foo), and also seem
to want to use the same thing in expressions ... so
actually permitting you to do that by means of the
plain old function call (is_foo) doesn't seem like
quite an orthogonal issue.

I do agree that guards beyond the use of "," and ";"
seem unsatisfactory at this point. (Basically, I think
things would have turned out for the better if the
designers had taken their inspiration from Prolog.)
Nor do I really see the point of two collections of
nearly-identical type test primitives (is_X/1 vs X/1).


Yahoo! FareChase: Search multiple travel sites in one click.

More information about the erlang-questions mailing list