Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature in k2.8 not in Kona #642

Open
gitonthescene opened this issue Mar 17, 2023 · 2 comments
Open

Feature in k2.8 not in Kona #642

gitonthescene opened this issue Mar 17, 2023 · 2 comments
Labels

Comments

@gitonthescene
Copy link

I know the goal is to have Kona match K2 and possibly K3. Here's something I discovered when trying to parse sql.k

  abc[`f`g`h`i`j]:(0 1 2 10 20 30;101 102 103 104 3 4;`f`e`d`c`b`a;2 3 8 2 9 0;1 2 1 2 2 2)
  t:`abc
  @[t;"+[f;1]"]
1 2 3 11 21 31

I.e. it's evaluating +[f;1] where f is taken as from the table abc. (Since t is the symbol `abc it's acting on the global.)

This seems like a pretty advanced feature and I was a little surprised to find this worked like this. It feels like it's an early incarnation of expressions in K9.

@gitonthescene
Copy link
Author

One way to make this work is to simply replace f with abc[`f] and reevaluate it. I haven't thought through how to fully test how this feature actually works in k2.8.

@gitonthescene
Copy link
Author

gitonthescene commented Mar 17, 2023

Interestingly, if I try to access a global in this expression it errors:

  b:7
  @[t;"+[f;b]"]
  @[t;"+[f;b]"]
value error
b

It feels like if Amend is given a string, then that string is passed through the parser again, but with the dictionary itself replacing "globals".

@tavmem tavmem added the feature label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants