[plt-scheme] match.ss epsilon
With "match.ss", is there a way to optionally match a subpattern,
without consuming if there is no match?
I couldn't find syntax like "optional" or, better yet, "empty":
(match '(b c) (((optional 'a) 'b 'c) #t)) => #t
(match '(b c) (((or 'a empty) 'b 'c) #t)) => #t
Nor, I suppose, an upper-bound extension of the multiplicity syntax:
(match '(b c) (('a ..0..1 'b 'c) #t)) => #t
The answer must be staring me in the face...
(Of course the above example can be done using two match clauses, but I
want to avoid combinatoric explosion of subpatterns in hairier cases.)
--
http://www.neilvandyke.org/