File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 365365 (emit-meta-constant x
366366 (persistent-hash-map-emit-kv-pairs key-names val-names)))))
367367
368+ (defn- persistent-hash-set-emit-seq [items]
369+ (emit-seq-construction items
370+ " VAR_NAME (cljc_DOT_core_DOT_PersistentHashSet_SLASH_EMPTY)"
371+ " FUNCALL2 ((closure_t*)VAR_NAME (cljc_DOT_core_SLASH__conj), "
372+ #(emits " , " %)
373+ " )" ))
374+
368375(defmethod emit-constant clojure.lang.PersistentHashSet [x]
369- (FIXME-IMPLEMENT ))
376+ (let [names (doall (map emit-constant x))]
377+ (emit-value-wrap :const-map nil
378+ (emit-meta-constant x
379+ (persistent-hash-set-emit-seq names)))))
370380
371381(defmacro emit-declaration [& body]
372382 `(swap! declarations conj (with-out-str ~@body)))
Original file line number Diff line number Diff line change 286286
287287(deftest constants
288288 (testing " constants"
289- (is (= (core-run '(pr (count '[(1 2 )
290- {3 4 }])))
291- 2 ))))
289+ (is (= (core-run '(pr '(1 2 )
290+ (let [m '{3 4 5 6 }]
291+ (list (keys m) (vals m)))
292+ (map identity '#{7 8 })))
293+ '[(1 2 ) ((3 5 ) (4 6 )) (7 8 )]))))
292294
293295(deftest loops
294296 (testing " simple loops"
You can’t perform that action at this time.
0 commit comments