Welcome to the CHICKEN Scheme pasting service

no title pasted by Anonymous Coward on Thu Oct 19 20:33:22 2017

(define (scanl f init ls)
  (if (equal? ls '())
      (list init)
      (let ((next (scanl f (f init (first ls)) (rest ls)) ))
        (cons init next)
        )))

More direct translation of the Haskell example added by sjamaan on Thu Oct 19 20:38:07 2017

(define (scanl f init ls)
  (cons init
        (if (null? ls)
            '()
            (scanl f (f init (car ls)) (cdr ls)))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg provides `string-pad-right'?
Visually impaired? Let me spell it for you (wav file) download WAV