DNS query: Difference between revisions
Content added Content deleted
(Added entry for unix statement/function in FB 7.0.23 and newer) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 2,074: | Line 2,074: | ||
However, if Wren is embedded in (say) a suitable Go program, then we can ask the latter to do it for us. |
However, if Wren is embedded in (say) a suitable Go program, then we can ask the latter to do it for us. |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">/* DNS_query.wren */ |
||
class Net { |
class Net { |
||
Line 2,085: | Line 2,085: | ||
which we embed in the following Go program and run it: |
which we embed in the following Go program and run it: |
||
{{libheader|WrenGo}} |
{{libheader|WrenGo}} |
||
<syntaxhighlight lang="go">/* go run |
<syntaxhighlight lang="go">/* go run DNS_query.go */ |
||
package main |
package main |
||
Line 2,108: | Line 2,108: | ||
func main() { |
func main() { |
||
vm := wren.NewVM() |
vm := wren.NewVM() |
||
fileName := " |
fileName := "DNS_query.wren" |
||
methodMap := wren.MethodMap{"static lookupHost(_)": lookupHost} |
methodMap := wren.MethodMap{"static lookupHost(_)": lookupHost} |
||
classMap := wren.ClassMap{"Net": wren.NewClass(nil, nil, methodMap)} |
classMap := wren.ClassMap{"Net": wren.NewClass(nil, nil, methodMap)} |