Re: is there "this"?

2016-11-04 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Thursday, 3 November 2016 at 13:40:11 UTC, Steven Schveighoffer wrote: On 11/2/16 4:43 AM, Jonathan M Davis via Digitalmars-d-learn In the case of the original post, however, you *need* to use this.value, as the parameter masks the member of the same name. Using 'this' removes ambiguity.

Re: is there "this"?

2016-11-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, November 03, 2016 09:40:11 Steven Schveighoffer via Digitalmars-d-learn wrote: > On 11/2/16 4:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Wednesday, November 02, 2016 02:42:01 Konstantin Kutsevalov via > > > > Digitalmars-d-learn wrote: > >> I tested already and it r

Re: is there "this"?

2016-11-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/2/16 4:43 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Wednesday, November 02, 2016 02:42:01 Konstantin Kutsevalov via Digitalmars-d-learn wrote: I tested already and it really works, thank you. I asked that because I tried once to use "this" in past but I got error. So I asked o

Re: is there "this"?

2016-11-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 02, 2016 02:42:01 Konstantin Kutsevalov via Digitalmars-d-learn wrote: > I tested already and it really works, thank you. > I asked that because I tried once to use "this" in past but I got > error. So I asked on some forum "how to get property of class?" > and peoples said

Re: is there "this"?

2016-11-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 02, 2016 07:26:57 Bauss via Digitalmars-d-learn wrote: > Well "this" in D has different meanings as it depends on its > context sometimes. Yes, but it's almost always the same thing that you'd expect from a language like C++ or Java. - Jonathan M Davis

Re: is there "this"?

2016-11-02 Thread Bauss via Digitalmars-d-learn
On Wednesday, 2 November 2016 at 02:42:01 UTC, Konstantin Kutsevalov wrote: On Wednesday, 2 November 2016 at 02:33:10 UTC, Konstantin Kutsevalov wrote: On Wednesday, 2 November 2016 at 02:20:43 UTC, rikki cattermole wrote: On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote: [...] You forgot

Re: is there "this"?

2016-11-01 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Wednesday, 2 November 2016 at 02:33:10 UTC, Konstantin Kutsevalov wrote: On Wednesday, 2 November 2016 at 02:20:43 UTC, rikki cattermole wrote: On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote: The question is simple. Is there something like "this" word for classes? For example: ``` cla

Re: is there "this"?

2016-11-01 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Wednesday, 2 November 2016 at 02:20:43 UTC, rikki cattermole wrote: On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote: The question is simple. Is there something like "this" word for classes? For example: ``` class CLS { int numberValue; public this(numberValue) { //

Re: is there "this"?

2016-11-01 Thread rikki cattermole via Digitalmars-d-learn
On 02/11/2016 3:17 PM, Konstantin Kutsevalov wrote: The question is simple. Is there something like "this" word for classes? For example: ``` class CLS { int numberValue; public this(numberValue) { // how can I put the local numberValue to class property? // in so

is there "this"?

2016-11-01 Thread Konstantin Kutsevalov via Digitalmars-d-learn
The question is simple. Is there something like "this" word for classes? For example: ``` class CLS { int numberValue; public this(numberValue) { // how can I put the local numberValue to class property? // in some prog language I can do like: // this.numbe