Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
7
Task/JSON/Hoon/json-2.hoon
Normal file
7
Task/JSON/Hoon/json-2.hoon
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(var object {:a 1 :b "Hello, world!" [1 2 3] :c}
|
||||
serialised (to-json object)
|
||||
deserialised (from-json serialised))
|
||||
|
||||
(print "Object: " object)
|
||||
(print "Serialised: " serialised)
|
||||
(str "Deserialised: " deserialised)
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
var json = require('JSON').new;
|
||||
var data = json.decode('{"blue": [1, 2], "ocean": "water"}');
|
||||
say data;
|
||||
data{:ocean} = Hash.new(water => %w[fishy salty]);
|
||||
say json.encode(data);
|
||||
var json = require('JSON::PP').new
|
||||
var data = json.decode('{"blue": [1, 2], "ocean": "water"}')
|
||||
say data
|
||||
data{:ocean} = Hash(water => %w[fishy salty])
|
||||
say json.encode(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue