[racket] need workaround for bug in match w/ list-no-order and a repeating pattern

From: Ryan Davis (zenspider at gmail.com)
Date: Tue Feb 4 04:27:01 EST 2014

https://github.com/plt/racket/issues/562

takikawa helped reduce the reproduction down to:

  (match '(1 1) [(list-no-order b b) 'x])

but what I'm actually trying to do is:

  (match '(...
           (nand b b w1)
           ...
           (nand w1 w1 w2)
           ...)
    [(list-no-order `(nand ,a ,a ,b)
                    `(nand ,b ,b ,c) rest ...)
     <rewrite c to a in rest>]
    [else 'bad])

I'm assuming that this bug is legit, but I know that match is incredibly powerful and assume some sort of workaround for this problem exists. Or there is the possibility of another tool that I don't yet know about. I just want to get this project off the ground to show that it can work. Suggestions / workarounds welcome. Thanks.



Posted on the users mailing list.