Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fold

Name: Anonymous 2008-02-02 15:04

http://www.haskell.org/haskellwiki/Fold
Haskell has map in terms of 'foldr ((:) . f) []'

How would you implementd foldr, and then map with foldr in scheme/lisp?

Name: Anonymous 2008-02-02 16:10

>>5-7

(define (compose . l)
  (lambda (x)
    (define (compose-iter l x)
       (if (null? l) x
           (compose-iter (cdr l) ((car l) x))))
     (compose-iter l x)))


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List