Add a variable to a class instance at runtime: Difference between revisions
Content added Content deleted
(Added Kotlin) |
|||
Line 448: | Line 448: | ||
:class foo |
:class foo |
||
object-list inst-objects \ a dynamically growable object container |
object-list inst-objects \ a dynamically growable object container |
||
:m init: inst-objects init: ;m |
|||
:m add: ( obj -- ) inst-objects add: ;m |
:m add: ( obj -- ) inst-objects add: ;m |
||
:m at: ( idx -- obj ) inst-objects at: ;m |
:m at: ( idx -- obj ) inst-objects at: ;m |