(defun make-greedy-star (m)
(lambda (s k q)
(if (funcall m (target s))
(funcall (make-greedy-star m) (copy-state s
:matched (target s)
:target (next-target))
k (lambda (s. k. q.)
(declare (ignore k. s.))
(funcall k s k q.)))
(funcall q s k q))))Source Context