Skip to content

Commit f9d7b17

Browse files
committed
- add back printing logic
1 parent d998f13 commit f9d7b17

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12487,7 +12487,10 @@ reduces them without incurring seq initialization"
1248712487
(-invoke [coll k]
1248812488
(-lookup coll k))
1248912489
(-invoke [coll k not-found]
12490-
(-lookup coll k not-found)))
12490+
(-lookup coll k not-found))
12491+
12492+
IPrintWithWriter
12493+
(-pr-writer [coll writer opts] (pr-sequential-writer writer pr-writer "[" " " "]" opts coll)))
1249112494

1249212495
(set! (. Vector -EMPTY) (Vector. nil (array)))
1249312496

@@ -12583,12 +12586,29 @@ reduces them without incurring seq initialization"
1258312586
(-invoke [coll k]
1258412587
(-lookup coll k))
1258512588
(-invoke [coll k not-found]
12586-
(-lookup coll k not-found)))
12589+
(-lookup coll k not-found))
12590+
12591+
IPrintWithWriter
12592+
(-pr-writer [coll writer opts]
12593+
(print-map coll pr-writer writer opts)))
1258712594

1258812595
(set! (. ObjMap -EMPTY) (ObjMap. nil (array) (js-obj)))
1258912596

1259012597
(set! (. ObjMap -fromObject) (fn [ks obj] (ObjMap. nil ks obj)))
1259112598

12599+
(defn obj-map
12600+
"keyval => key val
12601+
Returns a new object map with supplied mappings."
12602+
[& keyvals]
12603+
(let [ks (array)
12604+
obj (js-obj)]
12605+
(loop [kvs (seq keyvals)]
12606+
(if kvs
12607+
(do (.push ks (first kvs))
12608+
(gobject/set obj (first kvs) (second kvs))
12609+
(recur (nnext kvs)))
12610+
(.fromObject ObjMap ks obj)))))
12611+
1259212612
; The keys field is an array of all keys of this map, in no particular
1259312613
; order. Each key is hashed and the result used as a property name of
1259412614
; hashobj. Each values in hashobj is actually a bucket in order to handle hash
@@ -12681,7 +12701,11 @@ reduces them without incurring seq initialization"
1268112701
(-invoke [coll k]
1268212702
(-lookup coll k))
1268312703
(-invoke [coll k not-found]
12684-
(-lookup coll k not-found)))
12704+
(-lookup coll k not-found))
12705+
12706+
IPrintWithWriter
12707+
(-pr-writer [coll writer opts]
12708+
(print-map coll pr-writer writer opts)))
1268512709

1268612710
(set! (. HashMap -EMPTY) (HashMap. nil 0 (js-obj)))
1268712711

@@ -12739,6 +12763,9 @@ reduces them without incurring seq initialization"
1273912763
(-invoke [coll k]
1274012764
(-lookup coll k))
1274112765
(-invoke [coll k not-found]
12742-
(-lookup coll k not-found)))
12766+
(-lookup coll k not-found))
12767+
12768+
IPrintWithWriter
12769+
(-pr-writer [coll writer opts] (pr-sequential-writer writer pr-writer "#{" " " "}" opts coll)))
1274312770

1274412771
(set! (. Set -EMPTY) (Set. nil (hash-map)))

0 commit comments

Comments
 (0)