>
> (defn left-total [lst]
>   (reverse (first (reduce (fn [[acc tot] cur]
>                             [(cons [cur tot] acc) (+ tot cur)])
>                           [nil 0]
>                           lst))))

(defn left-total [s]
  (reverse (reduce (fn [y x] (cons (list x (reduce + (first y))) y))
() s)))

sorry, had not read whole message

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to