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

From: Jens Axel Søgaard <jensaxel>
Date: Thu Sep 28 08:49:31 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
Received on Thu Sep 28 2006 - 08:49:08 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC