Dynamic variable names: Difference between revisions

Content added Content deleted
(→‎Insitux: implementation)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,466: Line 1,466:
{{libheader|Wren-trait}}
{{libheader|Wren-trait}}
Although Wren is dynamically typed, it is not possible to create new variables at run time. However, we can simulate this using a map which is what the Var class in Wren-trait does under the hood.
Although Wren is dynamically typed, it is not possible to create new variables at run time. However, we can simulate this using a map which is what the Var class in Wren-trait does under the hood.
<syntaxhighlight lang="ecmascript">import "./ioutil" for Input
<syntaxhighlight lang="wren">import "./ioutil" for Input
import "./trait" for Var
import "./trait" for Var