Get system command output: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
Line 1,760:
However, if Wren is embedded in (say) a suitable Go program, then we can ask the latter to do it for us.
 
<syntaxhighlight lang="ecmascriptwren">/* get_system_command_outputGet_system_command_output.wren */
class Command {
foreign static output(name, param) // the code for this is provided by Go
Line 1,769:
which we embed in the following Go program and run it.
{{libheader|WrenGo}}
<syntaxhighlight lang="go">/* get_system_command_outputGet_system_command_output.go */
package main
 
Line 1,800:
func main() {
vm := wren.NewVM()
fileName := "get_system_command_outputGet_system_command_output.wren"
methodMap := wren.MethodMap{"static output(_,_)": getCommandOutput}
classMap := wren.ClassMap{"Command": wren.NewClass(nil, nil, methodMap)}
9,482

edits