syntax idea: simplifed ifs

Derek Parnell derek at psych.ward
Thu Apr 13 17:29:58 PDT 2006


On Fri, 14 Apr 2006 05:58:54 +1000, Bruno Medeiros  
<brunodomedeirosATgmail at SPAM.com> wrote:

> One can do this with plain old functions. Well, with typesafe variadic  
> functions that is:
>    equalsAny( x + y, 10, b, c)
> also possible (but somewhat weird..) :
>    equals(x + y).AnyOf(10, b, c)
>
> Or am I missing something terribly obvious? :o

You are missing nothing ... we can do lots of stuff using functions.

    equals(result, add(x,y))

or

   result = x + y;

Why do we have such syntax sugar?

-- 
Derek Parnell
Melbourne, Australia



More information about the Digitalmars-d mailing list