Jump to content

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

Added Arturo implementation
m (Fixed XBS example)
(Added Arturo implementation)
Line 66:
I am Class with 1
</pre>
 
=={{header|Arturo}}==
 
<lang rebol>define :myClass [name,surname][]
 
myInstance: to :myClass ["John" "Doe"]
print myInstance
 
myInstance\age: 35
print myInstance</lang>
 
{{out}}
 
<pre>[name:John surname:Doe]
[name:John surname:Doe age:35]</pre>
 
=={{header|AutoHotkey}}==
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.