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

Association[RuleDelayed[...]] is not supported #124

Open
holyjak opened this issue Sep 23, 2024 · 2 comments
Open

Association[RuleDelayed[...]] is not supported #124

holyjak opened this issue Sep 23, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@holyjak
Copy link
Member

holyjak commented Sep 23, 2024

This works:

(wl/eval (w/MessageName w/Interpreter "noknow"))
"The Wolfram Knowledgebase is not available. Try again later."

but this fails

(wl/->clj "Association[RuleDelayed[\"MessageTemplate\", MessageName[Interpreter, \"noknow\"]]]")
(AssertionError) at wolframite.base.parse/parse-hash-map

because currently the parse code only supports Rule and not RuleDelayed. Such an association is returned for example when running (wl/eval (list (w/Interpreter "City") "San Francisco, US")) while offline.

How to fix?

  1. Treat RuleDelayed just as Rule, i.e. turn it into {"MessageTemplate" ^:wolfram/delayed (MessageName Interpreter "noknow"))}
  2. Treat is specially - perhaps replacing it with delay: {"MessageTemplate" -> (delay (wl/eval (MessageName Interpreter "noknow"))))} ? Though an eval inside is ugly...
  3. Treat is as Rule but somehow mark it s rule delayed - with metadata, or wrapping it in delay as-is ((delay (MessageName ...)); i.e. not to do anything, but an indication that something can be done, ...
@holyjak holyjak added the bug Something isn't working label Sep 23, 2024
@light-matters
Copy link
Contributor

I'm not sure I understand this. RuleDelayed works in other contexts so why not here?

@holyjak
Copy link
Member Author

holyjak commented Nov 15, 2024

Let's do option 1

@holyjak holyjak assigned holyjak and unassigned light-matters Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants