From b210216c711de9043964313662677dff513fde1d Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Wed, 10 Oct 2018 19:39:29 +0200 Subject: Go: use slices for list values --- cmd/interpreter/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cmd/interpreter') 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) } -- cgit v1.2.3-70-g09d2