Currently it is not possible to use list literals with or without variables in a pattern.
Thus something like this
`
(match ['(1 2 3)]
['(a b c)] a)
`
will result in a failing assert.
AssertionError Invalid list syntax (a b c) in (quote (a b c)).
There is a workaround for this by using :seq
and :guard
, as in
`
(match ['(1 2 3)]
[(([a b c] :seq) :guard list?)] a)
`
but it is rather tedious to write.
List matching would be very useful when writing macros and compilers.