[dmd-beta] D 2.059 beta 4

Nick Sabalausky bus_dmdbeta at semitwist.com
Mon Apr 9 15:32:01 PDT 2012


From: "Andrej Mitrovic" <andrej.mitrovich at gmail.com>
> On 4/9/12, Steve Schveighoffer <schveiguy at yahoo.com> wrote:
>> I'll also point out that if you really want to clarify what 'a' you are
>> talking about, you can do:
>>
>> typeof(this).a = a;
> 
> Yeah, I was mainly concerned with convenience and not semantics.
> 'this.a = a' is a simple way to disambiguate between parameters and
> fields.
> 
> Side-note: I frequently use an "alias typeof(this) This;" in my
> classes so I don't have to hard-code the name of the class/struct. I
> sort of wish 'This' was implicitly given to us for every struct/class
> type. :)

vote++



More information about the dmd-beta mailing list