Bank transaction custom printer.
This commit is contained in:
parent
75cc2c6d0e
commit
8775c6ce14
1 changed files with 13 additions and 1 deletions
|
@ -45,7 +45,8 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(import scheme
|
(import scheme
|
||||||
(chicken base))
|
(chicken base)
|
||||||
|
(chicken format))
|
||||||
|
|
||||||
;; Bank account is represented as a list with list with the following
|
;; Bank account is represented as a list with list with the following
|
||||||
;; elements: list of transactions, account number, bank code. This
|
;; elements: list of transactions, account number, bank code. This
|
||||||
|
@ -71,4 +72,15 @@
|
||||||
;; Creates a new bank transaction.
|
;; Creates a new bank transaction.
|
||||||
(define-record bank-transaction id date amount currency varsym message type)
|
(define-record bank-transaction id date amount currency varsym message type)
|
||||||
|
|
||||||
|
(set-record-printer! bank-transaction
|
||||||
|
(lambda (tr out)
|
||||||
|
(fprintf out "#<transaction ~A ~A ~A ~A ~A ~A ~A>"
|
||||||
|
(bank-transaction-id tr)
|
||||||
|
(bank-transaction-date tr)
|
||||||
|
(bank-transaction-amount tr)
|
||||||
|
(bank-transaction-currency tr)
|
||||||
|
(bank-transaction-varsym tr)
|
||||||
|
(bank-transaction-message tr)
|
||||||
|
(bank-transaction-type tr))))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue