Anonymous user
Add a variable to a class instance at runtime: Difference between revisions
Add a variable to a class instance at runtime (view source)
Revision as of 05:39, 6 March 2014
, 10 years agoAdded zkl
(→{{header|Ruby}}: Added another way of adding a method to a singleton) |
(Added zkl) |
||
Line 1,417:
% $s2 value time
can't read "time": no such variable</lang>
=={{header|zkl}}==
Once created, class structure is fixed. However, using reflection, you can blow apart the class structure, add what ever and recompile the class (at run time). The REPL does this to store intermediate user results (defined classes, functions, variables, etc). It is ugly, slow and left as an exercise to the reader who cares.
{{omit from|Applesoft BASIC}}
|