Skip to content

Commit

Permalink
fixed jsonl/read-str examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Oct 17, 2023
1 parent 68f5a09 commit e6d2eb5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/resources/com/github/jlangch/venice/jsonl.venice
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,18 @@
"""
:examples '(
"""
(let [json (json/write-str {:a 100 :b 200})]
(let [json (jsonl/write-str {:a 100 :b 200})]
(jsonl/read-str json :key-fn keyword))
""",
"""
(let [json (jsonl/write-str [{:a 100 :b 200} {:a 100 :b 200}])]
(jsonl/read-str json :key-fn keyword))
""",
"""
(try-with [sw (io/string-writer)]
(println sw (json/write-str {:a 100 :b 200}))
(println sw (json/write-str {:a 101 :b 201}))
(println sw (json/write-str {:a 102 :b 202}))
(println sw (jsonl/write-str {:a 100 :b 200}))
(println sw (jsonl/write-str {:a 101 :b 201}))
(println sw (jsonl/write-str {:a 102 :b 202}))
(flush sw)
(let [json @sw]
(jsonl/read-str json :key-fn keyword)))
Expand Down

0 comments on commit e6d2eb5

Please sign in to comment.