Jump to content

Add a variable to a class instance at runtime: Difference between revisions

Added 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}}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.