diff --git a/extlib/benz b/extlib/benz index 0f2a172f..6bc702bd 160000 --- a/extlib/benz +++ b/extlib/benz @@ -1 +1 @@ -Subproject commit 0f2a172ffcdce1e9732dd157f343b2aa0e1960db +Subproject commit 6bc702bd89c850a3287d8420793b1740c7503c5c diff --git a/piclib/picrin/base.scm b/piclib/picrin/base.scm index a7a3ddff..439a989a 100644 --- a/piclib/picrin/base.scm +++ b/piclib/picrin/base.scm @@ -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? diff --git a/piclib/picrin/dictionary.scm b/piclib/picrin/dictionary.scm index c5205711..4c2b1f12 100644 --- a/piclib/picrin/dictionary.scm +++ b/piclib/picrin/dictionary.scm @@ -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))