The Is Operator

Kyle G. kyle.james.gibson at gmail.com
Tue Oct 2 14:23:48 PDT 2007


Hi,

First time posting here on the NG, and certainly not my last.

D has a good deal of syntactic sugar which results in easier to read 
code. However, there's one particular thing that has been bothering me 
for a while now:

void foo(void[] var) {
  if (var !is null)
   // line of code
}

int main() {
  foo(null);
}

The code I am concerned about is "var !is null" which appears to 
translate to "var not is null" when it actually means "var is not null." 
Is there any special reason why we are unable to do "var isnot null" or 
"var is not null"?



More information about the Digitalmars-d mailing list