On Wednesday, 13 October 2021 at 11:13:32 UTC, Andrei Alexandrescu wrote:
> It's a tail wagging the proverbial dog. Clearly we could do with better ways. We can improve the with
statement as follows:
I prefer with() while using the arsd.simpledisplay because it's needed a scope.
However, when you use double with(), an issue to come up! Compiled as follows, my only solution is:
Painter window;
with(Color) window = new Painter("AxialPCB", black, gray, red);
with(window)
{
//...
}
window.Handlers.eventLoop(0);
The new ideas are great about with() like the same inline import! If I used this way, it can't access it from the outside:
with(new Painter("AxialPCB", Color.black, Color.gray, Color.red) { //*/ }