On Tue 21 Jun 2016 17:31, David Kastrup writes:
> Andy Wingo 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
Andy Wingo writes:
> Hi,
>
> On Tue 13 May 2014 12:47, David Kastrup writes:
>
>> The following code results in an error:
>>
>> (use-modules (srfi srfi-1))
>> (reduce-right + 0 (make-list 1 1))
>>
>> Backtrace:
>> In srfi/srfi-1.scm:
>> 379: 19 [recur (1 1 1 1 1 1 1 1 1 ...) (1 1 1 1 1 1 1
Hi,
On Tue 13 May 2014 12:47, David Kastrup writes:
> The following code results in an error:
>
> (use-modules (srfi srfi-1))
> (reduce-right + 0 (make-list 1 1))
>
> Backtrace:
> In srfi/srfi-1.scm:
> 379: 19 [recur (1 1 1 1 1 1 1 1 1 ...) (1 1 1 1 1 1 1 1 1 ...)]
> 379: 18 [recur (1 1 1
Mark H Weaver writes:
> David Kastrup writes:
>
>> For all the cleverness involved here, one has to run through the whole
>> list anyway. It makes no real sense to do this in this manner. The
>> motivation may be to have a warm cache when k is small, but the result
>> is self-defeating because
David Kastrup writes:
> The following code results in an error:
>
> (use-modules (srfi srfi-1))
> (reduce-right + 0 (make-list 1 1))
[...]
> srfi/srfi-1.scm:379:31: In procedure recur:
> srfi/srfi-1.scm:379:31: Throw to key `vm-error' with args `(vm-run "VM: Stack
> overflow" ())'.
Yes, t
The following code results in an error:
(use-modules (srfi srfi-1))
(reduce-right + 0 (make-list 1 1))
Backtrace:
In srfi/srfi-1.scm:
379: 19 [recur (1 1 1 1 1 1 1 1 1 ...) (1 1 1 1 1 1 1 1 1 ...)]
379: 18 [recur (1 1 1 1 1 1 1 1 1 ...) (1 1 1 1 1 1 1 1 1 ...)]
379: 17 [recur (1 1 1 1 1 1