On Sunday, 9 June 2013 at 11:11:47 UTC, bearophile wrote:
khurshid:

D language have like Pascal/Delphi "with statement", which very useful for writing readable code.

It's a quite useful statement, especially with enumerations or associative array literals, to avoid repeating many times their name:

switch (en) with (MyEnum) {
  case foo: ...
  case bar: ...
}

It's very good example!!

And, May be, this is'not bad, too :))

struct C
{
   alias byte  B;
   alias short S;
};

with(C)
{
   B b;
   S s;
}

Reply via email to