"with" should be deprecated with extreme prejudice

Sean Kelly sean at invisibleduck.org
Mon May 18 09:55:42 PDT 2009


Derek Parnell wrote:
> 
> I guess the reason for using with() is to avoid typing repetitive stuff.
> Would this work instead ...
> 
> 
>  int x, y;
>  with (p as "somevery.long.struct.or.class[17].name")
>  {
>       y += p.x;
>       ++p.x;
>  }

{
     ref p = somevery.long.struct.or.class[17].name;
     y += p.x;
     ++p.x;
}



More information about the Digitalmars-d mailing list