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

/PROG/SICP CHALLENGE

Name: Anonymous 2008-09-01 7:21

IMPLEMENT THE COLLECTOR!!!

(((((o) 'a) 'b) 'c)) ; => (a b c)

Name: Anonymous 2008-09-01 19:58


(define (id x) x)

(define (curry f)
  (lambda (x)
    (lambda (y)
      (f x y))))

(define (compose f g)
  (lambda (x) (f (g x))))

(define (col acc)
  (case-lambda
    (()  (acc '()))
    ((x) (col (compose acc ((curry cons) x))))))

(define (o)
  (col id))

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