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

perltie, fenced hash, and such.
(→‎wrong name?: Emulating a native type?)
(perltie, fenced hash, and such.)
Line 6:
 
:I am not sure that that was the right choice here. The task is titled "Create an Object/Native ...", and while TCL might not have objects it certainly has native stuff? Anyways, this site has always been about closest approximations (though I have been known to quibble about where we draw the boundaries on those issues). --[[User:Rdm|Rdm]] 12:46, 20 October 2010 (UTC)
 
:: The [[Perl]] solution will need to use [http://perldoc.perl.org/perltie.html perltie] to tie a <tt>%hash</tt> to some <tt>$object</tt>, so that <tt>%hash{$key} = $value</tt> calls the magic method <tt>$object->STORE($key, $value)</tt>, and one writes code for <tt>STORE</tt>. If Perl has no perltie feature, I would omit this task from Perl. If Tcl has both dicts and objects, but Tcl has nothing like perltie, then one should omit this task from Tcl. --[[User:Kernigh|Kernigh]] 02:51, 17 February 2011 (UTC)
 
== wrong name? ==
Line 13 ⟶ 15:
 
: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)
 
:I am the author of the Ruby code in progress. I chose the name "fenced hash" in the Ruby code, but "fenced hash" might be bad name of page. I had trouble with two parts of the task description. First, I had to guess what "No new item can be added" does mean. For the Ruby code, I decided that no new KEY can be added. Second, I know what is "native hash", but I am not understanding what is "native way of object creation" or "native demonstration". The word "native" would have different meaning there. After I finish the Ruby code, I might edit the task description. After we fix the task description, we should drop "native demonstration" name. --[[User:Kernigh|Kernigh]] 02:51, 17 February 2011 (UTC)
Anonymous user