We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
;; works: (def typed-data-yaml " the-bin: !!binary 0101") (clj-yaml.core/parse-string typed-data-yaml) ;= {:the-bin #<byte[] [B@61911e64>} (clj-yaml.core/generate-string (clj-yaml.core/parse-string typed-data-yaml) :dumper-options {:flow-style :block}) ;= "the-bin: !!binary |-\n 0101\n" ;; generate-string creates a sequence instead of a set: (def set-yaml " --- !!set ? Mark McGwire ? Sammy Sosa ? Ken Griff") (clj-yaml.core/parse-string set-yaml) ;= #{"Mark McGwire" "Ken Griff" "Sammy Sosa"} (clj-yaml.core/generate-string (clj-yaml.core/parse-string set-yaml) :dumper-options {:flow-style :block}) ;= "- Mark McGwire\n- Ken Griff\n- Sammy Sosa\n" (clj-yaml.core/parse-string (clj-yaml.core/generate-string (clj-yaml.core/parse-string set-yaml) :dumper-options {:flow-style :block})) ;= ("Mark McGwire" "Ken Griff" "Sammy Sosa")
The text was updated successfully, but these errors were encountered:
This allows for Sets that contain numbers only, or strings only:
clojure.lang.PersistentHashSet (encode [data] (java.util.HashSet. data)) clojure.lang.PersistentTreeSet (encode [data] (java.util.TreeSet. data))
Sorry, something went wrong.
… but this is better:
clojure.lang.IPersistentSet (encode [data] (into #{} (map encode data)))
example (with modified fn's):
=> (println (yaml-dump ["y" #{"d" 'b/c :a 2 [3 4 {5 6 :x [7 #{}]}]} "m" nil "n"])) --- - y - !!set a: null 2: null ? - 3 - 4 - 5: 6 x: - 7 - !!set {} : null d: null ? !!clojure.lang.Symbol name: c namespace: b : null - m - null - n ...
No branches or pull requests
The text was updated successfully, but these errors were encountered: