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

Cannot evaluate unlinearized (JSON) version of value(project_name) call #12

Closed
lucaswerkmeister opened this issue May 22, 2020 · 4 comments

Comments

@lucaswerkmeister
Copy link

The next implementation step for GraalEneyj is probably to implement function calls, and I figured that value(project_name) seems like a good first call to target: it uses a builtin (so no need to implement custom functions yet) and should be relatively simple overall. GraalEneyj also doesn’t support anything other than the canonical JSON representation yet, so I needed the JSON version of a function call. Eneyj can print that, fortunately:

> .evaluation off
evaluation is off

> .linearization off
linearization is off

> value(project_name)
{
  "Z1K1": "Z7",
  "Z7K1": "Z36",
  "K1": "Z28"
}

However, it looks like Eneyj is itself unable to evaluate that function call:

> {"Z1K1": "Z7", "Z7K1": "Z36", "K1": "Z28"}
error_in_function:
by_key(error(error_in_function, error(zobject_has_no_type, "Z36", "val"), nothing), "Z5K2")

So far, I was under the impression that the Eneyj CLI also accepted the canonical JSON representation, so this should work. Am I doing something wrong, or is this a bug in Eneyj?

@vrandezo
Copy link
Contributor

Bug in eneyj, it doesn't make sense it doesn't work. I never implemented that, good catch.

This one works:

{"Z1K1": "Z7", "Z7K1": {"Z1K1": "Z9", "Z9K1": "Z36"}, "K1": {"Z1K1": "Z9", "Z9K1": "Z28"}}

So really it should extend the code first, then it would work. Thanks for the bug report!

@lucaswerkmeister
Copy link
Author

Alright, thanks!

vrandezo added a commit that referenced this issue May 24, 2020
Fixing issue #12. Expands the JSON data when entered on the CLI.
@vrandezo
Copy link
Contributor

The commit should fix that. Let me know if it works, then we can close this.

@lucaswerkmeister
Copy link
Author

Thanks, it seems to be working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants