Adding properties/members to base types?

Steven Schveighoffer schveiguy at yahoo.com
Wed Sep 5 10:29:09 PDT 2007


I must be going crazy, but I thought this behavior was implemented in D.

Is this just something someone proposed as an enhancement or is it real?

int myfunc(int x)
{
   return x + 5;
}

int test()
{
  int m = 10;
  return m.myfunc;  // implicitly knows that it should call myfunc(m)
}

I can't find anywhere that this is mentioned, but I swear I read it 
somewhere, either in a newsgroup post or the D specs.

-Steve 




More information about the Digitalmars-d-learn mailing list