Creates a closure which tries to match REPETITION. It is assumedthat REPETITION has a constant number of repetitions.