IRC gateway: Difference between revisions

m
m (syntax highlighting fixup automation)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 300:
 
As it's not possible to access command line arguments directly from Wren when it is being embedded, we instead ask the gateway user to input details of the connections needed.
<syntaxhighlight lang="ecmascriptwren">/* irc_gatewayIRC_gateway.wren */
 
import "./dynamic" for Tuple
Line 358:
}</syntaxhighlight>
We now embed this script in the following Go program and run it from a terminal. To close the gateway just press Ctrl-C.
<syntaxhighlight lang="go">/* go run irc_gatewayIRC_gateway.go */
 
package main
Line 489:
cfg.LoadModuleFn = moduleFn
vm := cfg.NewVM()
var fileName = "irc_gatewayIRC_gateway.wren"
IRCMethodMap := wren.MethodMap{
"connect(_)": connect,
9,482

edits