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

→‎Tcl omitted: What is the task really about?
(Should we rename those by dropping the s?)
(→‎Tcl omitted: What is the task really about?)
Line 8:
 
:: 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)
 
::: Hmm, I suppose I could use a trace on an array to stop someone from changing it (which would be similar in spirit to the perltie approach). Ugly as anything though. It's also not really what I'd call writing a ''native'' implementation of the “object”; it's layering a whole load off stuff over the top instead. Dictionary values work just as fine for non-modifiable (as Tcl's value-model is based on immutable values) but there I think it's violating the spirit of the task. –[[User:Dkf|Donal Fellows]] 12:19, 10 March 2013 (UTC)
 
== wrong name? ==
Anonymous user