Changeset 32537 in project


Ignore:
Timestamp:
07/04/15 02:38:21 (5 years ago)
Author:
Peter Danenberg
Message:

alist-lib: Update argument-order for alist-fold.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/alist-lib

    r32372 r32537  
    129129=== {{alist-fold}}
    130130<procedure>(alist-fold alist f init) → object</procedure>
    131 Fold an alist; whose {{f}} takes key, accumulatum, value.
     131Fold an alist; whose {{f}} takes key, value, accumulatum.
    132132; {{alist}} : The alist to fold
    133 ; {{f}} : The function to apply to key, accumulatum, value
     133; {{f}} : The function to apply to key, value, accumulatum
    134134; {{init}} : The seed of the fold
    135135<enscript highlight="scheme">(define (alist-fold alist f init)
    136136  (fold (lambda (association accumulatum)
    137           (match association ((key . value) (f key accumulatum value))))
     137          (match association ((key . value) (f key value accumulatum))))
    138138        init
    139139        alist))
Note: See TracChangeset for help on using the changeset viewer.