Environment variables: Difference between revisions
m
→{{header|Wren}}: Minor tidy
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="
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">/*
package main
Line 1,364:
func main() {
vm := wren.NewVM()
fileName := "
methodMap := wren.MethodMap{"static variable(_)": getEnvironVariable}
classMap := wren.ClassMap{"Environ": wren.NewClass(nil, nil, methodMap)}
|