Email list hosting service & mailing list manager

Implementation of reduce-right in SRFI 1 TAKIZAWA Yozo (28 Dec 2021 08:49 UTC)
Re: Implementation of reduce-right in SRFI 1 Arthur A. Gleckler (08 Jan 2022 16:47 UTC)
Re: Implementation of reduce-right in SRFI 1 Alex Shinn (09 Jan 2022 23:20 UTC)
Re: Implementation of reduce-right in SRFI 1 John Cowan (10 Jan 2022 04:13 UTC)
Re: Implementation of reduce-right in SRFI 1 Alex Shinn (10 Jan 2022 04:42 UTC)
Re: Implementation of reduce-right in SRFI 1 Marc Nieper-Wi├čkirchen (10 Jan 2022 12:02 UTC)
Re: Implementation of reduce-right in SRFI 1 Arthur A. Gleckler (10 Jan 2022 16:31 UTC)
Re: Implementation of reduce-right in SRFI 1 Arthur A. Gleckler (23 Oct 2022 01:45 UTC)
Re: Implementation of reduce-right in SRFI 1 TAKIZAWA Yozo (10 Jan 2022 11:54 UTC)

Implementation of reduce-right in SRFI 1 TAKIZAWA Yozo 28 Dec 2021 08:49 UTC

Although this is not a specification topic but implementation, I send
it to the list as a related issue to confirm or clarify.

I found that many implementations of reduce-right, including the
reference implementation, seem to be defined as a left-to-right
version of the implementation of reduce, regardless of describing in
SRFI 1 which is (fold-right f ridentity list) under (f x ridentity) =
x. Is there any special reason for such definitions?

It is not a problem as long as (f x ridentity) = x, to define
concatenate for example. But I experienced being confused when (f x
ridentity) is not x, it is my fault of course, with different results
between actual Scheme implementations... And, I am making a toy LISP
implementation for my fun and educational purpose especially to show
fold/unfold usages so I want to know about the above issue also to
define as one of the samples.

Best regards,
--
TAKIZAWA Yozo