Skip to content

Instantly share code, notes, and snippets.

@ninjarobot
Created July 6, 2018 20:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninjarobot/d397b80b6072fd8deffe9bafd68b76e0 to your computer and use it in GitHub Desktop.
Save ninjarobot/d397b80b6072fd8deffe9bafd68b76e0 to your computer and use it in GitHub Desktop.
Parsing a JSON string in SWI-Prolog
?- use_module(library(http/json_convert)).
true.
?- json:atom_json_term('{"foo":"bar"}',T, []), T=json(J), J.foo=Bar.
T = json([foo=bar]),
J = [foo=bar],
Bar = bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment