Unmarshal.jl:实现一个Julia Unmarshal程序包该程序包在由另一个程序包解析后将根据一个编组的字符串构造Julia对象(当前已测试JSON

entertaining_1475 6 0 ZIP 2021-04-01 04:04:22

元帅 将解析后的格式字典解组到Julia对象中 安装: pkg> add Unmarshal 基本用法 目前,该程序包仅在解组JSON对象的情况下进行了测试,但目的是将来还要测试它是否适用于其他数据格式。 import Unmarshal using JSON input = " { \" bar \" : { \" baz \" : 17 }, \" foo \" : 3.14 } " struct Bar baz :: Int end struct Foo bar :: Bar end Unmarshal . unmarshal (Foo, JSON . parse (input)) # Foo(Bar(17)) jstring = JSON . json ( ones (Float64, 3 )) # "[1.0,1.0,1.0]" Unmarshal . unm

用户评论
请输入评论内容
评分:
暂无评论