kevinlawler / kona

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

Parse error? #508

Closed bakul closed 6 years ago

bakul commented 6 years ago

The following should return “cd”, not fail with rank error

(“abcdefghij”)2 3
tavmem commented 6 years ago

Surprise! ... apparently, this is not a bug ... (or maybe it was a bug in k2.8 also?) in k2.8

$ rlwrap -n ~/k2.8/k
K 2.8 2000-10-10 Copyright (C) 1993-2000 Kx Systems
Evaluation. Not for commercial use. 
\ for help. \\ to exit.

  (“abcdefghij”)2 3
character error
(“abcdefghij”)2 3
 ^
parse error

In kona

$ rlwrap -n ~/kona/k
kona      \ for help. \\ to exit.

  (“abcdefghij”)2 3
parse error
>  
bakul commented 6 years ago

Sorry, Apple's "smart quotes" messed it up. Try this:

("abcdedfhi")2 3
tavmem commented 6 years ago

That is exactly what I did try ... However, I was able to replicate that error that I think you are referring to in k2.8

$ rlwrap -n ~/k2.8/k
K 2.8 2000-10-10 Copyright (C) 1993-2000 Kx Systems
Evaluation. Not for commercial use. 
\ for help. \\ to exit.

  "abcdefghij"2 3
"cd"

In kona

$ rlwrap -n ~/kona/k
kona      \ for help. \\ to exit.

  "abcdefghij"2 3
rank error
>  
tavmem commented 6 years ago

This is a long, long standing regression. It was broken by commit 5adb213b30fa9f012bc624291aa9908be6b00ed0 made on Jan 12, 2013