Anonymous user
Add a variable to a class instance at runtime: Difference between revisions
Add a variable to a class instance at runtime (view source)
Revision as of 22:58, 6 August 2011
, 12 years ago→{{header|Elena}}
(→{{header|Perl 6}}: show shorthand mixin) |
|||
Line 171:
ELENA does not support adding a variable at run-time but it can be simulated with the help of a group object
<lang elena>#subject foo.
#class FieldContainer
Line 190 ⟶ 186:
#symbol Program =>
[
#var anObject :=
// adding a field
anObject :=
anObject set &foo:"bar".
'program'Output << anObject << ".foo=" << anObject foo.
].
</lang>
|