Often I find myself wanting to alias an expression, such as verbose fields, possibly nested. AFAIK, the with statement makes it easier, but not as good as it could have been. What I'd like to express is for example something like this:

with( a = instanceA.verboseFieldA.verboseFieldB,
      b = instanceA.aDescriptiveName,
      instanceC)
{
  // use a, b and value:
  b[value] = b[a + value] * (a*value)^^a;
}

// given:

struct A {
  B verboseFieldA;
  int[] aDescriptiveName;
  ...
}
struct B {
  int verboseFieldB;
  ...
}
struct C {
  int value;
  ...
}

A instanceA;
B instanceB;
C instanceC;


1) Is it possible to achieve something similar in D now? And if not: 2) Are there any implementation considerations in this direction, extending the with statement?

Reply via email to