Add a variable to a class instance at runtime: Difference between revisions

m
→‎{{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="ecmascriptwren">import "io" for Stdin, Stdout
 
class Birds {
9,476

edits