With block proposal

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Thu Aug 27 08:57:42 PDT 2009


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.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list