June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,7 +1,13 @@
|
|||
julia> import JSON
|
||||
# Pkg.add("JSON") ... an external library http://docs.julialang.org/en/latest/packages/packagelist/
|
||||
using JSON
|
||||
|
||||
julia> JSON.parse("""{ "blue": [1,2], "ocean": "water" }""")
|
||||
["ocean"=>"water","blue"=>{1,2}]
|
||||
sample = Dict()
|
||||
sample["blue"] = [1, 2]
|
||||
sample["ocean"] = "water"
|
||||
|
||||
julia> JSON.json({"blue" => [1,2] , "ocean" => "water"})
|
||||
"{\"ocean\":\"water\",\"blue\":[1,2]}"
|
||||
@show sample jsonstring = json(sample)
|
||||
@show jsonobj = JSON.parse(jsonstring)
|
||||
|
||||
@assert jsonstring == "{\"ocean\":\"water\",\"blue\":[1,2]}"
|
||||
@assert jsonobj == Dict("ocean" => "water", "blue" => [1, 2])
|
||||
@assert typeof(jsonobj) == Dict{String, Any}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue