Implies operator
Mariano
rotoshi at yahoo.com
Fri Nov 17 03:57:23 PST 2006
== Quote from antonio (antonio at abrevia.net)'s article
> Kristian Kilpi wrote:
> > Now when I think about it, I have to say that 'x implies y' is a lot
> > easier to understand than '!x || y'.
Yeap, it only takes a minute or two to get use to it.
> antonio wrote:
> The most common example is the null check...
Yes, both -> and <- could be used.
For instances, in order to decide weather to show an error or not regarding its level and the
user-option of showing mild errors or not, we could decide to write it one way or the other
considering which on is ''cheaper'' to do first.
if( hideMildErrors -> GetErrorLevelFromFarAway() > 3 ) writefln(err);
and
if( error.level>3 <- readLongConfigFile("hideMildErrors") ) writefln(err);
Of course, all this could be again used with only ! and || (or &&).
I see only answers regarding the notation instead of the matter of having such operator or not.
As I said, there are several ways to write it, be it ->, --> or ==>, none of which represent
any comflict with the lexic of current version of the language.
Mariano.
More information about the Digitalmars-d
mailing list