|You wouldn't write it like this, but you could:|
I'm currently not using as-patterns for pattern matching, just destructuring:
def (pair? (x | (first ... (rest | (second ... rest2)))))
I'm not sure how useful this is; every use case I've seen for it seems worse than just using car and cdr. Thoughts?
def (copy (x | (head ... tail)))
if (~bound? 'head) # enter even if x is not a list
(cons copy.head copy.tail)
P.S. Building this feature turned out to be shockingly easy: http://github.com/akkartik/wart/commit/90646d3980