diff options
| author | 2020-10-18 15:59:29 +0300 | |
|---|---|---|
| committer | 2020-10-18 15:59:29 +0300 | |
| commit | 8083cf8a46bd2aa359c0a84597ff6f985a2bba4a (patch) | |
| tree | 4cc36dce2842ade22116d37eff30f4f1afe0c7f4 /internals.scm | |
| parent | alist dict predicate check only first element; plist and alist size remove un... (diff) | |
fix plist size proc; rewrite dict-entries to use fold
Diffstat (limited to 'internals.scm')
| -rw-r--r-- | internals.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internals.scm b/internals.scm index fe8263e..9652aaa 100644 --- a/internals.scm +++ b/internals.scm @@ -198,8 +198,15 @@ dictionary))) (define (idict-entries vec dictionary) - (values (dcall dkeys vec dictionary) - (dcall dvalues vec dictionary))) + (define pair + (dcall dfold vec + (lambda (key value acc) + (cons (cons key (car acc)) + (cons value (cdr acc)))) + (cons '() '()) + dictionary)) + (values (reverse (car pair)) + (reverse (cdr pair)))) (define (idict-fold vec proc knil dictionary) (define acc knil) |
