This commit is contained in:
1 parent
c3b0da7b5c
commit
61211d93bb
2 files changed
+22
-6
No files matched your search
+4
-4
@@ -17,8 +17,8 @@
|
||||
[:global sym] (symbol? sym)))
|
||||
|
||||
(s/def ::pattern
|
||||
(s/or :var (s/and symbol?
|
||||
#(not= '... %))
|
||||
(s/or :wildcard #{'_}
|
||||
:var (s/and symbol? (complement #{'... '_}))
|
||||
:lit ::literal
|
||||
:list (s/and seq?
|
||||
(s/cat :leading (s/* ::pattern)
|
||||
@@ -119,8 +119,8 @@
|
||||
|
||||
(defn- unify* [pattern datum]
|
||||
(match [pattern datum]
|
||||
[[:var x] _]
|
||||
{x datum}
|
||||
[[:wildcard _] _] {}
|
||||
[[:var x] _] {x datum}
|
||||
|
||||
[[:list {:leading leading
|
||||
:trailing nil
|
||||
|
||||
Reference in new issue
Block a user