Hostname: Difference between revisions
m
→{{header|Wren}}: Minor tidy
m (→{{header|Wren}}: Minor tidy) |
|||
Line 1,050:
However, if Wren is embedded in (say) a suitable Go program, then we can ask the latter to get it for us.
<syntaxhighlight lang="
class Host {
foreign static name() // the code for this is provided by Go
Line 1,059:
which we embed in the following Go program and run it.
{{libheader|WrenGo}}
<syntaxhighlight lang="go">/*
package main
Line 1,076:
func main() {
vm := wren.NewVM()
fileName := "
methodMap := wren.MethodMap{"static name()": hostname}
classMap := wren.ClassMap{"Host": wren.NewClass(nil, nil, methodMap)}
|