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 09:20, 6 November 2023
, 6 months ago→{{header|Wren}}: Changed to Wren S/H
(New post.) |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
Line 2,082:
=={{header|Wren}}==
Although Wren is dynamically typed, it is not possible to add new variables (or fields as we prefer to call them) to a class at run time. We therefore follow the example of some of the other languages here and use a map field instead.
<syntaxhighlight lang="
class Birds {
|