Add bank account accessors.
This commit is contained in:
parent
51747cfe84
commit
29aa9d9eba
1 changed files with 8 additions and 0 deletions
|
@ -29,6 +29,9 @@
|
||||||
bank-account
|
bank-account
|
||||||
(
|
(
|
||||||
make-bank-account
|
make-bank-account
|
||||||
|
bank-account-transactions
|
||||||
|
bank-account-number
|
||||||
|
bank-account-bank
|
||||||
bank-account-insert
|
bank-account-insert
|
||||||
|
|
||||||
make-bank-transaction
|
make-bank-transaction
|
||||||
|
@ -49,6 +52,11 @@
|
||||||
(car maybe-transactions))))
|
(car maybe-transactions))))
|
||||||
(list transactions number bank)))
|
(list transactions number bank)))
|
||||||
|
|
||||||
|
;; Trivial accessors
|
||||||
|
(define bank-account-transactions car)
|
||||||
|
(define bank-account-number cadr)
|
||||||
|
(define bank-account-bank caddr)
|
||||||
|
|
||||||
;; Prepends given transaction to given bank account. It expects the
|
;; Prepends given transaction to given bank account. It expects the
|
||||||
;; transactions list to be the first element of the bank account
|
;; transactions list to be the first element of the bank account
|
||||||
;; list.
|
;; list.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue