Skip to content

Instantly share code, notes, and snippets.

@pyr

pyr/runscript.go Secret

Created Feb 7, 2021
Embed
What would you like to do?
package main
import (
"bufio"
"github.com/candid82/joker/core"
"log"
"os"
"strings"
)
func main() {
filename := "hello-script"
input := "(prn :foo)"
core.GLOBAL_ENV.InitEnv(os.Stdin, os.Stdout, os.Stderr, os.Args[1:])
core.GLOBAL_ENV.SetMainFilename(filename)
core.ProcessCoreData()
rdr := core.NewReader(
bufio.NewReader(strings.NewReader(input)),
filename,
)
err := core.ProcessReader(rdr, filename, core.EVAL)
if err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment