Comment 2 for bug 301612

Revision history for this message
Ramūnas Gutkovas (ramunasg) wrote :

Oh, sorry for the duplication. I am quite new to launchpad, and don't know how to get around :)

match+ is for passing multiple values, to do some paralell accumulation, e.g.:

(define expr '(1 2 (3) (5 (6)) 4))
(define x '()) ;; x must be bound

(match+ (x) expr
   ((,(a*) ...) (values a* a*)) ; the first arg passed to values whould be bound to x, second whould be normally returned just like in match
   (,a (values a a)))

whould return reconstructed list twice (multiple values):

(1 2 (3) (5 (6)) 4)
(1 2 (3) (5 (6)) 4)

hope that helps, I am not very good at explaining how things work :)