Alternative Possibility - Implicit with

Paul Backus snarwin at gmail.com
Sat Nov 19 14:22:16 UTC 2022


On Saturday, 19 November 2022 at 12:57:33 UTC, Adam D Ruppe wrote:
> Actually, I do wish `with` in general had a way to refer back 
> to the subject of it. Maybe we could add something there then 
> it'd magically apply to the implicit with too.

Maybe something like this for symbols:

     with (alias me = SomeReallyLongName)

And this for expressions:

     with (auto me = some(complex, ex + pression))

Can be implemented by lowering to a normal block scope:

     {
         alias me = SomeReallyLongName;
         with (me)
         {
             // ...
         }
     }


More information about the Digitalmars-d mailing list