aboutsummaryrefslogtreecommitdiff
path: root/cmd/interpreter
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-10-10 19:39:29 +0200
committerPřemysl Janouch <p@janouch.name>2018-10-10 19:39:29 +0200
commitb210216c711de9043964313662677dff513fde1d (patch)
treeb82bc3419c69444f39d1f9219d6398769cfbc2bd /cmd/interpreter
parentfb143f4d2772780b1f681200729443fcb8f03d39 (diff)
downloadell-b210216c711de9043964313662677dff513fde1d.tar.gz
ell-b210216c711de9043964313662677dff513fde1d.tar.xz
ell-b210216c711de9043964313662677dff513fde1d.zip
Go: use slices for list values
Diffstat (limited to 'cmd/interpreter')
-rw-r--r--cmd/interpreter/main.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd/interpreter/main.go b/cmd/interpreter/main.go
index 97c8c25..bd70af3 100644
--- a/cmd/interpreter/main.go
+++ b/cmd/interpreter/main.go
@@ -49,14 +49,12 @@ func main() {
os.Exit(1)
}
- var args *ell.V
- tail := &args
+ var args []ell.V
for i := 2; i < len(os.Args); i++ {
- *tail = ell.NewString(os.Args[i])
- tail = &(*tail).Next
+ args = append(args, *ell.NewString(os.Args[i]))
}
- var result *ell.V
+ var result []ell.V
if !L.EvalBlock(program, args, &result) {
fmt.Printf("%s: %s\n", "runtime error", L.Error)
}