Environment variables: Difference between revisions

m
No edit summary
m (→‎{{header|Wren}}: Minor tidy)
Line 1,338:
 
However, if Wren is embedded in (say) a suitable Go program, then we can ask the latter to obtain it for us.
<syntaxhighlight lang="ecmascriptwren">/* environment_variablesEnvironment_variables.wren */
class Environ {
foreign static variable(name)
Line 1,347:
which we embed in the following Go program and run it.
{{libheader|WrenGo}}
<syntaxhighlight lang="go">/* environment_variablesEnvironment_variables.go */
package main
 
Line 1,364:
func main() {
vm := wren.NewVM()
fileName := "environment_variablesEnvironment_variables.wren"
methodMap := wren.MethodMap{"static variable(_)": getEnvironVariable}
classMap := wren.ClassMap{"Environ": wren.NewClass(nil, nil, methodMap)}
9,485

edits