(unit/sig (collect) (import (u : plt:userspace^)) ;; collect ;; given a base-case "base" and a rule "combine" for combining a list, ;; the first thing in the list, and the recursive call, ;; return: ;; a function which actually goes ;; and calls combine on each list recursevely, ;; collecting the result and returning it. ;; (define collect (lambda (base combine) (local ((define C (lambda (l) (cond ((null? l) base) (else (combine l (car l) (C (cdr l)))))))) C))) )