JohnEarnest / ok

An open-source interpreter for the K5 programming language.
MIT License
585 stars 73 forks source link

Add support for l_n drop #73

Closed lkowalick closed 6 years ago

lkowalick commented 6 years ago

In k4, there is another overload of _ for the form l_n, where we remove the element at index y from x. Again, not having a k5/k6 interpreter, but using k4, I get that

KDB+ 3.3 2015.06.09 Copyright (C) 1993-2015 Kx Systems
m32/ 4()core 16384MB rkowalick ryans-macbook-pro.local 192.168.0.103 NONEXPIRE  

q)\
  5 6 7 8 9_3
5 6 7 9
   5 6 7 8 9_5
5 6 7 8 9
  5 6 7 8 9_-2
5 6 7 8 9

I have some code attached and I tried to make it similar to what was there, but a few monkey wrenches made it a little longer than I would have liked. Any shortcuts would be appreciated

JohnEarnest commented 6 years ago

Hmm. While I appreciate the idea, I don't think I can include this. Experimenting with k5 and k6 I can find no evidence of an overload for dyadic _ which behaves along these lines. I don't hold myself to rigid compatibility with Arthur's interpreters, but I try to be sparing about introducing novel features to the core language.

lkowalick commented 6 years ago

That's fine. It was also an exercise to see if I could actually add something to the interpreter.