kevinlawler / kona

Open-source implementation of the K programming language
ISC License
1.36k stars 138 forks source link

Resume works ... but only in simple cases #567

Closed tavmem closed 4 years ago

tavmem commented 4 years ago

Making the test case just a bit more complex

K 2.8 2000-10-10 Copyright (C) 1993-2000 Kx Systems
\ for help. \\ to exit.

  3 + 2 * 6 - 4
7
  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  : 2 * 6 - 4
7
kona      \ for help. \\ to exit.

  3 + 2 * 6 - 4
7
  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  : 2 * 6 - 4
type error
3 + "x" * 2 * 6 - 4
at execution instance 3 of "*"
> 
tavmem commented 4 years ago

After commit 567f9949dfba86e356d2adee3907c796d27cd2bb

kona      \ for help. \\ to exit.

  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  : 2 * 6 - 4
7

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
>  : 7 + 3
10 10 10 10

  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  2+2
4
>  : 2 * 6 - 4
type error
3 + "x" * 2 * 6 - 4
at execution instance 2 of "*"
> 
tavmem commented 4 years ago

After the commit listed above:

kona      \ for help. \\ to exit.

  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  : 2 * 6 - 4
7

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
>  : 7 + 3
10 10 10 10

  3 + "x" * 6 - 4
type error
3 + "x" * 6 - 4
        ^
>  2+2
4
>  : 2 * 6 - 4
7