Advertisement
Guest User

mbakke

a guest
Mar 26th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.21 KB | None | 0 0
  1.  
  2. (define (string-cumulative source)
  3.   (let ((prefix ""))
  4.     (map
  5.      (lambda (c)
  6.        (set! prefix (string-append prefix c))
  7.        prefix)
  8.      source)))
  9.  
  10. (write (string-cumulative '("A" "B" "C")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement