Add a variable to a class instance at runtime: Difference between revisions
Content added Content deleted
Line 569: | Line 569: | ||
=={{header|OxygenBasic}}== |
=={{header|OxygenBasic}}== |
||
Simple implementation for making runtime members - supports integer, float and string types |
Simple implementation for making runtime members - supports integer, float and string types. |
||
<lang oxygenbasic> |
<lang oxygenbasic> |
||
'================= |
'================= |
||
class fleximembers |
class fleximembers |
||
Line 643: | Line 642: | ||
a.delete |
a.delete |
||
</lang |
</lang> |
||
=={{header|Oz}}== |
=={{header|Oz}}== |
||
It is not possible to add variables to instances in Oz. Every object has exactly one class and this association cannot be changed after object creation. Classes themselves are immutable. |
It is not possible to add variables to instances in Oz. Every object has exactly one class and this association cannot be changed after object creation. Classes themselves are immutable. |