D's greatest mistakes

Manfred_Nowak svv1999 at hotmail.com
Mon Nov 29 13:25:16 PST 2010


Daniel Gibson wrote:

> "with" shouldn't be much of a problem anymore.

import std.stdio;
struct X{ int a, b, c;}
struct Y{ int a, b;}
void main(){
  X x;
  Y y;
  with( x){
    c= 2;
    with( y){
      c= 1;
    }
  }
  writeln( x.c);
}

Do you see the not "much of a problem"?

-manfred


More information about the Digitalmars-d mailing list