First off, is there a way to make ... in a pattern match non-greedily? i.e., match as *few* elements as possible instead of as many?
Second, is there a way to make one pattern refer to an earlier pattern in the same match clause? Semi-regularly I find myself wanting to do something like 'match repeated elements' or 'match if items from these two lists match'. For example: (match (list '(a b c) '(d e c)) [(list (list _ ... x) (list _ ... y)) #:when (equal? x y) 'ok] [else 'nope]) => 'ok (match '(a b c c d) [(list _ ... x y _ ...) #:when (equal? x y) 'ok] [else 'nope]) => 'ok Is there a way to do this without needing a #:when clause? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAE8gKoe78-7sBjHu%3DoR6kg4t4xqaTXjOAa1bHoE_G%2BZKpW6%3DTw%40mail.gmail.com.