diff --git a/examples/list.vqe b/examples/list.vqe index 82dbdcc..98ca803 100755 --- a/examples/list.vqe +++ b/examples/list.vqe @@ -1 +1 @@ -("test this" (*test*) ) pi cons 2 cons 1 cons 4 { split exch disp newline } repeat +("test this" (*test*) ) pi cons 2 cons 1 cons 4 { split disp newline } repeat diff --git a/varaq/interpreter.go b/varaq/interpreter.go index e0a0749..d75e59c 100644 --- a/varaq/interpreter.go +++ b/varaq/interpreter.go @@ -345,9 +345,10 @@ func Interpret(code Expr, argv []string, w io.Writer) error { } if list.Tok == LIST { n := len(list.Exprs) - 1 - push(list.Exprs[n]) + e := list.Exprs[n] list.Exprs = list.Exprs[:n] push(list) + push(e) } else { return fmt.Errorf("cannot `split` not a list @%v", idx) }