File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77## [ Unreleased]
88### Fixed
99 * Fix a bug where ` # ` characters were not legal in keywords and symbols (#1149 )
10+ * Fix a bug where seqs were not considered valid input for matching clauses of the ` case ` macro (#1148 )
1011
1112## [ v0.3.3]
1213### Added
Original file line number Diff line number Diff line change 35373537 (mapcat (fn [pair]
35383538 (let [binding (first pair)
35393539 expr `(fn [] ~(second pair))]
3540- (if (list ? binding)
3540+ (if (seq ? binding)
35413541 (map #(vector (list 'quote %) expr) binding)
35423542 [[(list 'quote binding) expr]])))
35433543 (partition 2
Original file line number Diff line number Diff line change 316316 (let [l #py [1 2 3]]
317317 (is (= 6 (areduce l idx ret 0 (+ ret (aget l idx)))))))
318318
319+ (defmacro case-with-seq
320+ []
321+ `(case :val
322+ ~(seq [:val]) :found))
323+
319324(deftest case-test
320325 (is (= "yes" (case :a :b "nope" :c "mega nope" :a "yes" "nerp")))
321326 (is (= "nope" (case :b :b "nope" :c "mega nope" :a "yes" "nerp")))
328333 (is (= "also no" (case 'd :a "no" (b c d) "also no" "duh")))
329334 (is (= "duh" (case 'e :a "no" (b c d) "also no" "duh")))
330335 (is (= 0 (case 1 0)))
336+ (is (= :found (case-with-seq)))
331337 (let [out* (atom [])]
332338 (is (= 2 (case :2
333339 :1 (do (swap! out* conj 1) 1)
You can’t perform that action at this time.
0 commit comments