[standard-reports] convert to srfi-9

because 2-arg record-constructor is being deprecated.

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=f7b4055b
This commit is contained in:
Christopher Lam
2019-10-23 19:27:20 +08:00
parent df187e70b7
commit d881130a19

View File

@@ -25,6 +25,7 @@
(define-module (gnucash report standard-reports))
(use-modules (srfi srfi-9))
(use-modules (srfi srfi-13))
(use-modules (gnucash utilities))
(use-modules (gnucash core-utils))
@@ -39,26 +40,15 @@
;; or without split. If no function is found, then run the 'default'
;; function
(define acct-type-info (make-record-type "AcctTypeInfo" '(split non-split)))
(define make-acct-type-private
(record-constructor acct-type-info '(split non-split)))
(define-record-type :acct-type-info
(make-acct-type-private split non-split)
acct-type?
(split get-split set-split)
(non-split get-non-split set-non-split))
(define (make-acct-type)
(make-acct-type-private #f #f))
(define get-split
(record-accessor acct-type-info 'split))
(define set-split
(record-modifier acct-type-info 'split))
(define get-non-split
(record-accessor acct-type-info 'non-split))
(define set-non-split
(record-modifier acct-type-info 'non-split))
(define (gnc:register-report-hook acct-type split? create-fcn)
(let ((type-info (hash-ref gnc:*register-report-hash* acct-type (make-acct-type))))
(if split?