Finish the loader.

This commit is contained in:
Dominik Pantůček 2023-03-30 13:49:05 +02:00
parent 71e016a3aa
commit b86360904f
2 changed files with 31 additions and 4 deletions

View file

@ -43,8 +43,11 @@
;; Bank account is represented as a list with list with the following
;; elements: list of transactions, account number, bank code. This
;; allows cheap transaction prepending.
(define (make-bank-account number bank)
(list '() number bank))
(define (make-bank-account number bank . maybe-transactions)
(let ((transactions (if (null? maybe-transactions)
'()
(car maybe-transactions))))
(list transactions number bank)))
;; Prepends given transaction to given bank account. It expects the
;; transactions list to be the first element of the bank account