Re: Question regarding the setter method/proc

2018-02-12 Thread rajydv23
To the best thing the play online game is [https://texttwist.online](https://texttwist.online) so more the chance to the great.

Re: Question regarding the setter method/proc

2017-08-29 Thread Udiknedormin
@Lando I think you misunderstood me. I like properties for the reasons you mentioned (mainly: not giving a damn). I just don't like the fact they work differently in the module the type is defined in. As for whether properties are good: it depends. Memoized properties are often a good

Re: Question regarding the setter method/proc

2017-08-29 Thread Lando
@Udiknedormi: I see how that would make sense. There is that ambiguity that _a.host = 34_ can mean two completely different things inside the module: * call the assignment operator * call a procedure named _host=_ But Nim seems to consciously embrace ambiguity to accomplish separation of

Re: Question regarding the setter method/proc

2017-08-28 Thread Udiknedormin
It seems to me it would be better to not allow a getter/setter to be named just like a private field. It's quite misleading.

Re: Question regarding the setter method/proc

2017-08-28 Thread pgmf
Thanks again @Lando for confirming this. It more clear to me now. Best Regards

Re: Question regarding the setter method/proc

2017-08-28 Thread Lando
Correct. This is why the name of the field was changed to something other than _host_ in the updated example code.

Re: Question regarding the setter method/proc

2017-08-28 Thread pgmf
@Lando, Many thanks for your reply, much appreciated. I was really confused. This is how I understand the concept from your reply. Please correct me if I am wrong. * if ' s.host = 34 ' is called from the _same module_, it will directly access the object variable bypassing the 's.host='

Re: Question regarding the setter method/proc

2017-08-28 Thread Lando
The example from the tutorial is a bit misleading, try the updated [version from the language manual](https://nim-lang.org/docs/manual.html#procedures-properties) instead. The _host_ field of a _Socket_ object is invisible to code from a different module, but the tutorial example code accesses

Re: Question regarding the setter method/proc

2017-08-28 Thread pgmf
Aplologies, there was an error in my program, corrected now. My question still stands though. Thanks.

Question regarding the setter method/proc

2017-08-28 Thread pgmf
Hello all, A newbie here. I have been learning Nim using the online tutorials and is thoroughly enjoying Nim . I have completed the part 1 and have advanced to Part 2 of the tutorial. Have a question regarding the setter methods discussed in the 'Properties' section of the tutorial. Can you