YAML
更新了基于Snake YAML的Clojure的YAML库,并受到clj-yaml的极大启发
安装
莱因
用法
( ns demo.core
( :refer-clojure :exclude [ load ])
( :require [yaml.core :as yaml]))
; ; Note on DSL
; ; yaml/load & yaml/parse-string are identical
; ; yaml/dump & yaml/generate-string are identical
; ; Parse a YAML file
( yaml/from-file " config.yml " )
; ; Parse a YAML string
( yaml/parse-string " foo: bar " )
; ; Optionally pass `true` as a second argument to from-file or parse-string to keywordize all keys
( yaml/parse-string
1