mirror of
https://github.com/janet-lang/janet
synced 2024-11-29 03:19:54 +00:00
Improve use of @
in match.
This commit is contained in:
parent
fd70b47768
commit
f7b49a2c91
@ -1407,9 +1407,9 @@
|
||||
~(do (def ,pattern ,expr) ,(onmatch))))
|
||||
|
||||
(and (tuple? pattern) (= :parens (tuple/type pattern)))
|
||||
(if (and (= (pattern 0) '@) (symbol? (pattern 1)))
|
||||
(if (= (get pattern 0) '@)
|
||||
# Unification with external values
|
||||
~(if (= ,(pattern 1) ,expr) ,(onmatch) ,sentinel)
|
||||
~(if (= ,(get pattern 1) ,expr) ,(onmatch) ,sentinel)
|
||||
(match-1
|
||||
(in pattern 0) expr
|
||||
(fn []
|
||||
|
Loading…
Reference in New Issue
Block a user