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 13:39, 9 June 2017
, 7 years ago→{{header|Elena}}
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
|||
Line 326:
=={{header|Elena}}==
ELENA does not support adding a field at run-time but it can be simulated with the help of a mix-in.
ELENA 3.
<lang elena>
class Extender :: BaseExtender
{
object
constructor new : anObject
Line 346:
anObject := Extender new:anObject.
anObject
console
console readChar.
|