1 | function loadDKJSON(sID) |
2 | local env = setmetatable({}, {__index=function(o, k) return _G[k] end }) |
3 | return assert(loadSnippet(sID, env))() |
4 | end |
5 | |
6 | json = loadDKJSON('#44') |
7 | |
8 | print(json.encode{'hello', 'world'}) |
9 | print(json.encode{a='hello', b=2}) |
10 | t = json.decode('["hello","world"]') |
11 | print(t[1], t[2]) |
works!! :)
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 308 | [visualize] |
Snippet ID: | #77 |
Snippet name: | dkjson test |
Eternal ID of this version: | #77/1 |
Text MD5: | 293b5e28e535f8879e6e4070a6764b8e |
Author: | stefan |
Category: | tests |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2014-01-02 06:34:22 |
Source code size: | 308 bytes / 11 lines |
Pitched / IR pitched: | Yes / Yes |
Views / Downloads: | 1719 / 794 |
Referenced in: | [show references] |