update benz (dictionary-api)

This commit is contained in:
Yuichi Nishiwaki 2014-09-13 16:52:42 +09:00
parent d2ad6e3111
commit ecdc6ffd66
3 changed files with 11 additions and 19 deletions

@ -1 +1 @@
Subproject commit 0f2a172ffcdce1e9732dd157f343b2aa0e1960db
Subproject commit 6bc702bd89c850a3287d8420793b1740c7503c5c

View File

@ -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?

View File

@ -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))