func primStr(e Env, head ast.Node, args []ast.Node) ast.Node { var buffer bytes.Buffer // TODO replace below with calls to .FriendlyString() for _, arg := range args { buffer.WriteString(arg.FriendlyString()) } return ast.NewStr(buffer.String()) }
func primReadableString(e Env, head ast.Node, args []ast.Node) ast.Node { return ast.NewStr(args[0].String()) }
func primReadLine(e Env, head ast.Node, args []ast.Node) ast.Node { s := readLine() // TODO: uses a global variable :( trimmed := strings.TrimSuffix(s, "\n") return ast.NewStr(trimmed) }