Suppose we are often writing something like
theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]=x;
One would like to something like
alias shortName = theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex];
shortName = x;
but you can't alias an expression.
You can do
(ref shortName) {
shortName = x;
}(theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]);
but that doesn't read well since the ``definition'' of shortName comes at the end.
Another option is
auto aliasAs(alias f,T)(ref T x) { return f(x); }
theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex].aliasAs!
(ref shorName) {
shortName = x;
}
Thoughts?