fold-ec[syntax] fold-ec x0 qualifier ... expression f2[syntax] fold3-ec x0 qualifier ... expression f1 f2SRFI-42: Reduces the sequence x[0], x[1], ..., x[n-1] of values obtained by evaluating expression once for each binding as specified by qualifier .. .. The arguments x0, f2, and f1, all syntactically equivalent to expression, specify the reduction process. The reduction process for fold-ec is defined as follows. A reduction variable x is initialized to the value of x0, and for each k in {0, ..., n-1} the command (set! x (f2 x[k] x)) is evaluated. Finally, x is returned as the value of the comprehension. The reduction process for fold3-ec is different. If and only if n = 0, i.e. the sequence is empty, then x0 is evaluated and returned as the value of the comprehension. Otherwise, a reduction variable x is initialized to the value of (f1 x[0]), and for each k in {1, ..., n-1} the command (set! x (f2 x[k] x)) is evaluated. Finally, x is returned as the value of the comprehension. As the order of the arguments suggests, x0 is evaluated outside the scope of the qualifiers, whereas the reduction expressions involving f1 and f2 are inside the scope of the qualifiers (so they may depend on any variable introduced by the qualifiers). Note that f2 is evaluated repeatedly, with any side-effect or overhead this might have. | About This SiteHome Alphabetical Indexa b c d e f g h i j k l m n o p q r s t u v w x y z other ConceptsConcept:CaseSensitivity Concept:DocumentationFormat Concept:ExtendedLambdaList Concept:FileSystem Concept:FindAndAnyInCollection Concept:ForeignInterface Concept:HashTable Concept:Module Concept:Networking Concept:ObjectSystem Concept:Process Concept:RegularExpression Concept:UserGroup Implementations
External Links |