[r6rs-discuss] Question about fold-* procedures ?

Jens Axel Søgaard jensaxel at soegaard.net
Thu Sep 28 08:49:08 EDT 2006


Stanislav Ievlev skrev:
> On Wed, Sep 27, 2006 at 01:05:12PM +0400, Stanislav Ievlev wrote:
>> In SRFI-1 fold-left is a iterative process, but fold-right is a recursive process.

>> Phrase:
>> "iterates the kons procedure over the values of the lists" means that in
>> R6RS fold-right is an iterative process, isn't it?

The whole sentence is:

   The fold-right procedure iterates the kons procedure
   over the values of the lists from right to left and an
   accumulator value, starting with an accumulator value of
   nil .

In this context the "iterates" just means that fold-right
is repeating something, namely the application of kons to
a value and the accumulator value.

> Can anybody answer me about it?

Also, even though SRFI 1 specifies the result returned
by fold and fold-right with a recursive specification,
it does say whether the evalutation proces should be
recursive or iterative. That's just an implementation
detail.

-- 
Jens Axel Søgaard





More information about the r6rs-discuss mailing list