Topic variable: Difference between revisions

Added Wren
m (→‎{{header|Raku}}: Fix link: Perl 6 --> Raku)
(Added Wren)
Line 642:
=={{header|VBA}}==
VBA does not have special or topic variables. All variables have a letter as their first character.
 
=={{header|Wren}}==
Wren doesn't have topic variables as such though they can be simulated by declaring a variable with a short name (preferably a single capital letter) at the top of a module so that it is then in scope throughout the module. As Wren is dynamically typed, any value can be assigned to such a variable subsequently.
 
Note that you can't use a single or double underscore as the variable name for this purpose as they always denote instance or static fields of a class.
<lang ecmascript>var T // global scope
 
var doSomethingWithT = Fn.new { [T * T, T.sqrt] }
 
T = 3
System.print(doSomethingWithT.call())</lang>
 
{{out}}
<pre>
[9, 1.7320508075689]
</pre>
 
=={{header|zkl}}==
9,479

edits