[racket] Calculating cumulative sum of the list

From: William James (w_a_x_man at yahoo.com)
Date: Thu Jan 22 14:37:26 EST 2015

(require srfi/1)

(unfold-right null? (curry apply +) cdr (reverse '(1 3 5 7)))
 ===>
'(1 4 9 16)


--------------------------------------------
On Thu, 1/22/15, Alexandr M <rus314 at gmail.com> wrote:

 Subject: [racket] Calculating cumulative sum of the list
 To: users at racket-lang.org
 Date: Thursday, January 22, 2015, 7:53 AM
 
 Hello,
 
 I am trying to replicate functionality of this code in
 Python:
 
 https://gist.github.com/m-blog/22b7c5d31b3839ffba50#file-cumsum-py
 
 in Racket without usage of any libraries.
 
 What would the most optimal / concise way to do it in
 Racket?
 
 Thank you.
 
 -- 
 Best regards,
 Alex
 
 
 -----Inline Attachment Follows-----
 
 ____________________
   Racket Users list:
   http://lists.racket-lang.org/users
 


Posted on the users mailing list.