aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/interpreter/main.go4
-rw-r--r--cmd/repl/main.go3
2 files changed, 2 insertions, 5 deletions
diff --git a/cmd/interpreter/main.go b/cmd/interpreter/main.go
index bd70af3..e0001a2 100644
--- a/cmd/interpreter/main.go
+++ b/cmd/interpreter/main.go
@@ -53,9 +53,7 @@ func main() {
for i := 2; i < len(os.Args); i++ {
args = append(args, *ell.NewString(os.Args[i]))
}
-
- var result []ell.V
- if !L.EvalBlock(program, args, &result) {
+ if _, ok := L.EvalBlock(program, args); !ok {
fmt.Printf("%s: %s\n", "runtime error", L.Error)
}
}
diff --git a/cmd/repl/main.go b/cmd/repl/main.go
index b1bb413..3511931 100644
--- a/cmd/repl/main.go
+++ b/cmd/repl/main.go
@@ -29,8 +29,7 @@ import (
)
func run(L *ell.Ell, program []ell.V) {
- var result []ell.V
- if !L.EvalBlock(program, nil, &result) {
+ if result, ok := L.EvalBlock(program, nil); !ok {
fmt.Printf("\x1b[31m%s: %s\x1b[0m\n", "runtime error", L.Error)
L.Error = ""
} else {