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
|
||||
(
|
||||
make-bank-account
|
||||
bank-account-transactions
|
||||
bank-account-number
|
||||
bank-account-bank
|
||||
bank-account-insert
|
||||
|
||||
make-bank-transaction
|
||||
|
@ -49,6 +52,11 @@
|
|||
(car maybe-transactions))))
|
||||
(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
|
||||
;; transactions list to be the first element of the bank account
|
||||
;; list.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue