fix nil pattern matching
This commit is contained in:
parent
705be69661
commit
e05043e375
|
@ -183,7 +183,7 @@
|
||||||
:word (match-word pattern value ctx)
|
:word (match-word pattern value ctx)
|
||||||
|
|
||||||
# match on equality
|
# match on equality
|
||||||
:nil {:success (nil? value) :ctx ctx}
|
:nil {:success (= :^nil value) :ctx ctx}
|
||||||
:bool {:success (= data value) :ctx ctx}
|
:bool {:success (= data value) :ctx ctx}
|
||||||
:number {:success (= data value) :ctx ctx}
|
:number {:success (= data value) :ctx ctx}
|
||||||
:string {:success (= data value) :ctx ctx}
|
:string {:success (= data value) :ctx ctx}
|
||||||
|
|
|
@ -52,8 +52,7 @@
|
||||||
(comment
|
(comment
|
||||||
# (do
|
# (do
|
||||||
(def source `
|
(def source `
|
||||||
fn id (x) -> x
|
contains? (:d, [:a, :b])
|
||||||
map (id, [])
|
|
||||||
`)
|
`)
|
||||||
(def out (-> source
|
(def out (-> source
|
||||||
ludus
|
ludus
|
||||||
|
|
Loading…
Reference in New Issue
Block a user