You are right.

; proc, init and lst are from the racket reference.

(define (my-foldl proc init lst)
  (define (rec res rest1)
    (if (null? rest1)
        res
        (rec (proc res (first rest1)) (rest rest1))))
  (rec init lst))

> (my-foldl (lambda (x y) (list x y)) '() '(a1 a2 a3 a4 a5))
'(((((() a1) a2) a3) a4) a5)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to