Skip to content

Commit

Permalink
Remove arrow from tagged-value constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
greglook committed Jan 19, 2015
1 parent 878ca11 commit c6f277f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/puget/data.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(str \# tag \space (pr-str value))))


(defn ->tagged-value
(defn tagged-value
"Creates a generic tagged value record to represent some EDN value. This is
suitable for use as a default-data-reader function."
[tag value]
Expand Down Expand Up @@ -67,7 +67,7 @@
ExtendedNotation
(->edn
[this#]
(->tagged-value ~tag (value-fn# this#))))))
(tagged-value ~tag (value-fn# this#))))))


(defmacro extend-tagged-str
Expand Down
4 changes: 2 additions & 2 deletions test/puget/data_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@


(deftest generic-tagged-value
(let [data (data/->tagged-value 'foo :bar)
(let [data (data/tagged-value 'foo :bar)
{:keys [tag value]} (data/->edn data)
string (data/edn-str data)]
(is (= 'foo tag))
(is (= :bar value))
(is (= "#foo :bar" (str data)))
(is (= data (edn/read-string {:default data/->tagged-value} string)))))
(is (= data (edn/read-string {:default data/tagged-value} string)))))


(defrecord TestRecord [x y])
Expand Down
4 changes: 2 additions & 2 deletions test/puget/printer_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@


(deftest canonical-tagged-value
(let [tv (data/->tagged-value 'foo :bar/baz)]
(let [tv (data/tagged-value 'foo :bar/baz)]
(is (= "#foo :bar/baz" (pprint-str tv))))
(let [tv (data/->tagged-value 'frobble/biznar [:foo :bar :baz])]
(let [tv (data/tagged-value 'frobble/biznar [:foo :bar :baz])]
(is (= "#frobble/biznar\n[:foo :bar :baz]" (pprint-str tv)))))


Expand Down

0 comments on commit c6f277f

Please sign in to comment.