Skip to content

Commit 76a19ed

Browse files
committed
Emit non-constant sets.
1 parent 77d6c77 commit 76a19ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/clj/cljc/compiler.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@
445445

446446
(defmethod emit :set
447447
[{:keys [items env]}]
448-
(FIXME-IMPLEMENT))
448+
(let [item-names (doall (map emit items))]
449+
(emit-value-wrap :set env
450+
(emits (persistent-hash-set-emit-seq item-names)))))
449451

450452
(defmethod emit :constant
451453
[{:keys [form env]}]

test/clojurec/core_test.clj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,7 @@
483483
(pr \a \b) (pr " ")
484484
(pr '(1 2 3)) (pr " ")
485485
(pr (make-array 2)) (pr " ")
486-
(pr (set (list 1 2 3)))
487-
(pr (hash-set 1 2 3))))
486+
(pr #{1 2 3})))
488487
[true false
489488
-1 0 1
490489
'a 'b
@@ -493,7 +492,6 @@
493492
\a \b
494493
'(1 2 3)
495494
[nil nil]
496-
#{1 2 3}
497495
#{1 2 3}]))))
498496

499497
(deftest equality

0 commit comments

Comments
 (0)