Re:Ask HN: How to compose two mapping functions into a third?
by elijahbuck on Wednesday December 10, 2008 @10:05PM
(#393881)
I might be missing something here, but what about this (I didn't even attempt to run this)? Basically, just call map1 and map2 with a single-number interval, and then apply the function from map3 to that result. This avoids making a local copy, but does require a lot of function calls.
(defun compmap (fn mapper1 mapper2 start end) (cond ((= start end) '()) (else (cons (fn start (+ (mapper1 start start) (mapper2 start start))) (compmap fn mapper1 mapper2 (+ start 1) end)))))