fix SPLIT ordering
This commit is contained in:
parent
8edcea969e
commit
9f1e1d6ad9
|
@ -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
|
||||||
|
|
|
@ -345,9 +345,10 @@ func Interpret(code Expr, argv []string, w io.Writer) error {
|
||||||
}
|
}
|
||||||
if list.Tok == LIST {
|
if list.Tok == LIST {
|
||||||
n := len(list.Exprs) - 1
|
n := len(list.Exprs) - 1
|
||||||
push(list.Exprs[n])
|
e := list.Exprs[n]
|
||||||
list.Exprs = list.Exprs[:n]
|
list.Exprs = list.Exprs[:n]
|
||||||
push(list)
|
push(list)
|
||||||
|
push(e)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("cannot `split` not a list @%v", idx)
|
return fmt.Errorf("cannot `split` not a list @%v", idx)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue