document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. (defn current-balance [accounts]
  2.   ;; Recursively loop over all accounts,
  3.   (loop [balance 0
  4.          accounts accounts]
  5.     (if (first accounts)
  6.       (let [[account transactions] (first accounts)]
  7.         (println "Processing account" account) ;; <--- Added to inspect the loop
  8.         (recur (+ balance (sum-transactions transactions))
  9.                accounts))
  10.       balance)))
  11.  
  12. ;;;; Re-running the code, the output shows this:
  13.  
  14. ;; Processing account :savings
  15. ;; Processing account :savings
  16. ;; Processing account :savings
  17. ;; Processing account :savings
  18. ;; Processing account :savings
  19. ;; ...
');