update benz (dictionary-api)
This commit is contained in:
parent
d2ad6e3111
commit
ecdc6ffd66
|
@ -1 +1 @@
|
|||
Subproject commit 0f2a172ffcdce1e9732dd157f343b2aa0e1960db
|
||||
Subproject commit 6bc702bd89c850a3287d8420793b1740c7503c5c
|
|
@ -170,10 +170,17 @@
|
|||
|
||||
(export make-dictionary
|
||||
dictionary?
|
||||
dictionary
|
||||
dictionary-ref
|
||||
dictionary-set!
|
||||
dictionary-delete
|
||||
dictionary-size)
|
||||
dictionary-size
|
||||
dictionary-map
|
||||
dictionary-for-each
|
||||
dictionary->plist
|
||||
plist->dictionary
|
||||
dictionary->alist
|
||||
alist->dictionary)
|
||||
|
||||
(export make-record
|
||||
record?
|
||||
|
|
|
@ -1,23 +1,6 @@
|
|||
(define-library (picrin dictionary)
|
||||
(import (picrin base))
|
||||
|
||||
(define (plist->dictionary plist)
|
||||
(let ((dict (make-dictionary)))
|
||||
(do ((kv plist (cddr kv)))
|
||||
((null? kv)
|
||||
dict)
|
||||
(dictionary-set! dict (car kv) (cadr kv)))))
|
||||
|
||||
(define (alist->dictionary alist)
|
||||
(let ((dict (make-dictionary)))
|
||||
(do ((kv alist (cdr kv)))
|
||||
((null? kv)
|
||||
dict)
|
||||
(dictionary-set! dict (car kv) (cdr kv)))))
|
||||
|
||||
(define (dictionary . plist)
|
||||
(plist->dictionary plist))
|
||||
|
||||
(export dictionary?
|
||||
dictionary
|
||||
make-dictionary
|
||||
|
@ -25,5 +8,7 @@
|
|||
dictionary-set!
|
||||
dictionary-delete
|
||||
dictionary-size
|
||||
dictionary->plist
|
||||
plist->dictionary
|
||||
dictionary->alist
|
||||
alist->dictionary))
|
||||
|
|
Loading…
Reference in New Issue