Re: Really nooB question - @property

2014-07-21 Thread Eric via Digitalmars-d-learn
Use @property when you want a pseudo-variable or something that might be conceptually considered a property of the object, i.e. to do this: auto blah = thing.someProperty; thing.someProperty = blahblah; This is basically what I suspected. But why write: @property int getValue() {

Re: Really nooB question - @property

2014-07-21 Thread John Colvin via Digitalmars-d-learn
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote: There are a lot of discussions in the forums about how @property should or could be implemented. But I can't seem to find anything that explains why or when I should use @property with the current compiler. Can anyone explain why and when

Re: Really nooB question - @property

2014-07-21 Thread John Colvin via Digitalmars-d-learn
On Sunday, 20 July 2014 at 17:59:07 UTC, John Colvin wrote: On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote: There are a lot of discussions in the forums about how @property should or could be implemented. But I can't seem to find anything that explains why or when I should use

Re: Really nooB question - @property

2014-07-21 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote: There are a lot of discussions in the forums about how @property should or could be implemented. But I can't seem to find anything that explains why or when I should use @property with the current compiler. Can anyone explain why and when

Re: Really nooB question - @property

2014-07-21 Thread Ali Çehreli via Digitalmars-d-learn
On 07/20/2014 11:14 AM, Eric wrote: Use @property when you want a pseudo-variable or something that might be conceptually considered a property of the object, i.e. to do this: auto blah = thing.someProperty; thing.someProperty = blahblah; This is basically what I suspected. But why

Re: Really nooB question - @property

2014-07-21 Thread John Colvin via Digitalmars-d-learn
On Sunday, 20 July 2014 at 18:14:29 UTC, Eric wrote: Use @property when you want a pseudo-variable or something that might be conceptually considered a property of the object, i.e. to do this: auto blah = thing.someProperty; thing.someProperty = blahblah; This is basically what I

Re: Really nooB question - @property

2014-07-21 Thread Danyal Zia via Digitalmars-d-learn
On Sunday, 20 July 2014 at 16:35:52 UTC, Eric wrote: There are a lot of discussions in the forums about how @property should or could be implemented. But I can't seem to find anything that explains why or when I should use @property with the current compiler. Can anyone explain why and when

Re: Really nooB question - @property

2014-07-21 Thread Kagamin via Digitalmars-d-learn
On Sunday, 20 July 2014 at 18:14:29 UTC, Eric wrote: Use @property when you want a pseudo-variable or something that might be conceptually considered a property of the object, i.e. to do this: auto blah = thing.someProperty; thing.someProperty = blahblah; This is basically what I