JSON: Difference between revisions
Content deleted Content added
Add solution for Lua using luajson |
m Move to correct position |
||
Line 1,454: | Line 1,454: | ||
(: jiffy decode '"{\"foo\": [1, 2, 3]}"))) |
(: jiffy decode '"{\"foo\": [1, 2, 3]}"))) |
||
(: io format '"~p: ~p~n" (list key value))) |
(: io format '"~p: ~p~n" (list key value))) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</lang> |
</lang> |
||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
Using the [ |
Using the [http://www.eharning.us/wiki/luajson/ luajson] library: |
||
<lang lua>local json = require("json") |
<lang lua>local json = require("json") |
||
Line 1,541: | Line 1,535: | ||
JSON re-encoded: [42,3.14159,[2,4,8,16,32,64,"apples","bananas","cherries"],{"Li":3,"He":2,"H":1,"X":null},null,true,false] |
JSON re-encoded: [42,3.14159,[2,4,8,16,32,64,"apples","bananas","cherries"],{"Li":3,"He":2,"H":1,"X":null},null,true,false] |
||
JSON from new Lua data: [42,3.14159,[2,4,8,16,32,64,"apples","bananas","cherries"],{"Li":3,"He":2,"H":1,"X":null},null,true,false] |
JSON from new Lua data: [42,3.14159,[2,4,8,16,32,64,"apples","bananas","cherries"],{"Li":3,"He":2,"H":1,"X":null},null,true,false] |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|MATLAB}} / {{header|Octave}}== |
=={{header|MATLAB}} / {{header|Octave}}== |