[dmd-beta] D 2.059 beta 4

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Apr 9 15:06:49 PDT 2012


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. :)


More information about the dmd-beta mailing list