Thanks, I know with statement could be used but I was hoping for a solution not involving adding syntax to call site.
void fun(with(A){A a}, int b){...} //conceptually like this void test(){ int a1=1; fun(A.a1, a1); // would work fun(a1, a1); // would work } On Wed, Aug 6, 2014 at 8:22 AM, Meta via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Wednesday, 6 August 2014 at 07:23:32 UTC, Rikki Cattermole wrote: > >> The magic of with statements! >> >> enum A { >> a1, >> a2 >> } >> >> void func(A a){} >> void main(){ >> func(A.a1); >> with(A) { >> func(a1); >> } >> } >> > > And if you want to be *really* concise: > > with (A) fun(a1); >