Advertisement
Guest User

Re-done account-map

a guest
Nov 22nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; our record-like map
  2. (def account-map {:fname "empty"
  3.                   :lname "empty"
  4.                   :d-o-b "00/00/00"
  5.                   :curr-amnt 0
  6.                   :dep-amnt 0
  7.                   :with-amnt 0
  8.                   :new-amnt 0})
  9.  
  10. ;; functions to do add up all deposits, withdraws, and then
  11. ;; calculate the new amount
  12. (defn deposit-withdraw-amnt [& x]
  13.   (+ 0 x))
  14. (defn new-amnt [deposit withdraw current]
  15.   (- (+ deposit current) withdraw))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement