Jump to content

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

Added PicoLisp
(Added Oz.)
(Added PicoLisp)
Line 259:
 
$e->{"foo"} = 1; // using a runtime name</lang>
 
=={{header|PicoLisp}}==
In general, all instance variables in PicoLisp are dynamically created at
runtime.
<lang PicoLisp>: (setq MyObject (new '(+MyClass))) # Create some object
-> $385605941
: (put MyObject 'newvar '(some value)) # Set variable
-> (some value)
: (show MyObject) # Show the object
$385605941 (+MyClass)
newvar (some value)
-> $385605941</lang>
 
=={{header|Pop11}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.