syntax idea: simplifed ifs
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Fri Apr 14 07:42:28 PDT 2006
Derek Parnell wrote:
> 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
I wasn't saying we should use functions, I was just saying they were
more adequate here than a template.
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list