Talk:Create an object/Native demonstration: Difference between revisions

→‎wrong name?: Emulating a native type?
m (→‎wrong name?: explain)
(→‎wrong name?: Emulating a native type?)
Line 11:
I think this task might have the wrong name. It might be better to call it "immutable map" or something like that. It's not so much a demonstration of creating an object and "native demonstration" doesn't make sense to me. --[[User:Mwn3d|Mwn3d]] 22:31, 16 February 2011 (UTC)
:Sorry to causing misunderstanding. I think Ruby's demonstration match, and in fact correct, my idea. The object requirements should be 1. No new KEY could be added, and KEY set at initialization cannot be removed ; 2. VALUE can be modified and can be reset (by method delete/reset/clear etc. whatever appropriate in the language) to DEFAULT VALUE which has been set at initialization. But the object creation task is just a means to expose those Magic Method, which is the real goal of this task. For example, one can make a hash class object that access values by key by using a method '''getValueByKey''', or by using a Native(?) method, for example in D, '''opIndex'''. It is this '''opIndex''' that I called Magic Method. I cannot express my idea well :( [[User:Dingowolf|dingowolf]] 23:19, 16 February 2011 (UTC)
 
:I too can see that it is '''not''' the fact that you are indeed creating an immutable map that is the point. It is how to make an object that acts just as a map does/should do, but with your outlined changes. I cannot come up with a better name than you have, at the moment.Oh wait, how about ''"Emulating a native type"'' ? --[[User:Paddy3118|Paddy3118]] 02:34, 17 February 2011 (UTC)
Anonymous user