bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17485: (srfi srfi-1) reduce-right does not scale, version 2.0.9


From: Andy Wingo
Subject: bug#17485: (srfi srfi-1) reduce-right does not scale, version 2.0.9
Date: Tue, 12 Jul 2016 09:07:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Tue 21 Jun 2016 17:31, David Kastrup <address@hidden> writes:

> Andy Wingo <address@hidden> writes:
>
>> I think on 2.0 that this might be an OK workaround:
>>
>>  (define (reduce-right f ridentity lst)
>>    (reduce f ridentity (reverse lst)))
>
> So if we don't store the inverse list in-space, it needs to be either a
> copy in heap (reverse) or stack (recursion).  Stack allocation is likely
> cheaper in execution time (though the total memory cost depends on the
> stack frame size taken per call).  The limited stack size on 2.0 does
> not seem like a good fit, however.  Which makes your workaround seem
> like the best option.

Applied this fix to stable-2.0.  Thanks for the report.

Andy





reply via email to

[Prev in Thread] Current Thread [Next in Thread]