With block proposal
Daniel Keep
daniel.keep.lists at gmail.com
Thu Aug 27 10:08:27 PDT 2009
Michiel Helvensteijn wrote:
> Freeman wrote:
>
>>> Example:
>>>
>>> with(a)
>>> {
>>> :x = x; // Unambiguously means a.x = x
>>> :x = .x; // Unambiguously means a.x = .x
>>> }
>
> I think the plan is to get rid of 'with', and I can't say I disagree.
>
> If you can say
>
> with(a) { :x = f(); :x = g(); }
>
> you can also say
>
> { auto w = a; w.x = f(); w.x = g(); }
>
> or similar.
>
> Hardly any longer, and without the need for a whole language construct.
Unless a is a value-type member of something else.
More information about the Digitalmars-d
mailing list