mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-14 00:17:33 +02:00
make-conf should validate it gets an alist
This commit is contained in:
parent
c9b4786648
commit
5f80618544
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue