Add a variable to a class instance at runtime: Difference between revisions
Content added Content deleted
m (Fixed XBS example) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 66: | Line 66: | ||
I am Class with 1 |
I am Class with 1 |
||
</pre> |
</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}}== |
=={{header|AutoHotkey}}== |