How to explicitly state the expression in with(...)?

Robert M. Münch robert.muench at saphirion.com
Sat Feb 1 21:06:50 UTC 2020


I have quite often this pattern:

with(x.y.z){
	xyzFunc();	// = x.y.z.xyzFunc()
	myFunc(x.y.z, ...);
}

and it would be cool to write:

with(t = x.y.z){ // work like an implicit alias
	xyzFunc();	// = x.y.z.xyzFunc()
	myFunc(t, ...);
}

Is there anything which comes near this idea?

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list