Basic bank account and transaction structures.
This commit is contained in:
parent
739d663f6d
commit
b0969ec182
2 changed files with 27 additions and 6 deletions
|
@ -26,12 +26,19 @@
|
|||
(declare (unit bank-account))
|
||||
|
||||
(module
|
||||
bank-account
|
||||
(
|
||||
make-bank-account
|
||||
bank-account-insert
|
||||
|
||||
make-bank-transaction
|
||||
bank-transaction-varsym
|
||||
bank-transaction-amount
|
||||
bank-transaction-currency
|
||||
)
|
||||
|
||||
(import scheme)
|
||||
(import scheme
|
||||
(chicken base))
|
||||
|
||||
;; Bank account is represented as a list with list with the following
|
||||
;; elements: list of transactions, account number, bank code. This
|
||||
|
@ -46,7 +53,14 @@
|
|||
(cons (cons transaction (car account))
|
||||
(cdr account)))
|
||||
|
||||
;; Creates a new bank transaction. The order of elements is
|
||||
;; well-suited for fast access to commonly used fields.
|
||||
(define (make-bank-transaction id date amount currency varsym)
|
||||
#f)
|
||||
(list varsym amount currency date id))
|
||||
|
||||
;; Accessors for the fields actually used
|
||||
(define bank-transaction-varsym car)
|
||||
(define bank-transaction-amount cadr)
|
||||
(define bank-transaction-currency caddr)
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue