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 | --now you can do stuff like: |
9 | --print(json.encode{'hello', 'world'})
|
10 | --print(json.encode{a='hello', b=2})
|
11 | --t = json.decode('["hello","world"]')
|
12 | --print(t[1], t[2]) |
Use with: go("#265")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
No comments. add comment
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 346 | [visualize] |
| Snippet ID: | #265 |
| Snippet name: | json.encode / json.decode (standard include) |
| Eternal ID of this version: | #265/1 |
| Text MD5: | 0e0d4c4b0f5bf3d8b6b086c6faa56db9 |
| Author: | stefan |
| Category: | standard includes |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-03-29 13:09:22 |
| Source code size: | 346 bytes / 12 lines |
| Pitched / IR pitched: | Yes / Yes |
| Views / Downloads: | 1008 / 281 |
| Referenced in: | [show references] |