With statement extension

Artur Skawina via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 28 04:10:21 PDT 2016


On 04/28/16 10:28, Adrian Matoga via Digitalmars-d wrote:
> On Wednesday, 27 April 2016 at 18:34:18 UTC, Artur Skawina wrote:
>> [...]
>>
>>        ref Ex1() { return e1.someProperties.someModulusX; }
> 
> Unless any of the properties is an enum or, well, a @property, and I'd expect both in such case.

s/ref/@property auto ref/, but it either won't matter in
practice (@property) or be easily fixable (non-lvals).

The main point was that what OP is asking for is yet another
function definition syntax. D has quite a few already, and
more are regularly requested (like overloading `alias`).
Adding a special case just for with-expressions wouldn't
be a good idea.

artur   





More information about the Digitalmars-d mailing list