Jump to content

Dynamic variable names: Difference between revisions

→‎Insitux: implementation
imported>Arakov
(→‎Insitux: implementation)
Line 583:
 
{{omit cat|Unicon}}
 
=={{Header|Insitux}}==
 
This first approach creates a function that creates a variable of that name.
 
<syntaxhighlight lang="insitux">
(let var-name "hello")
((eval (str "(var " var-name ")")) 123)
</syntaxhighlight>
 
This second approach puts the variable value directly in the evaluated string.
 
<syntaxhighlight lang="insitux">
(let var-name "hello")
(eval (str "(var " var-name " 123)"))
</syntaxhighlight>
 
=={{header|J}}==
112

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.