make-conf should validate it gets an alist

This commit is contained in:
Alex Shinn 2019-01-04 01:53:49 +08:00
parent c9b4786648
commit 5f80618544

View file

@ -76,13 +76,18 @@
;;> Returns true iff \var{x} is a config object.
(define-record-type Config
(make-conf alist parent source timestamp)
(%make-conf alist parent source timestamp)
conf?
(alist conf-alist conf-alist-set!)
(parent conf-parent conf-parent-set!)
(source conf-source conf-source-set!)
(timestamp conf-timestamp conf-timestamp-set!))
(define (make-conf alist parent source timestamp)
(if (not (alist? alist))
(error "config requires an alist" alist)
(%make-conf alist parent source timestamp)))
(define (assq-tail key alist)
(let lp ((ls alist))
(and (pair? ls)