Re: Eliminate numeric-range over inexact numbers?
Wolfgang Corcoran-Mathe 30 Aug 2020 20:56 UTC
On 2020-08-30 22:43 +0200, Marc Nieper-Wißkirchen wrote:
> Am So., 30. Aug. 2020 um 22:40 Uhr schrieb Wolfgang Corcoran-Mathe
> <xxxxxx@sigwinch.xyz>:
>
> > Agreed. The second, delayde version could be especially bad if PROC
> > is expensive.
>
> Or good because of the O(n) behavior of the first version. But that's
> just an observation and doesn't invalidate the argument.
So what's it to be? It seems to be a trade-off. Both approaches have
their uses, though it's not Scheme tradition to provide two versions of
the same procedure with different evaluation strategies.
(Another approach, evaluating (proc (range-ref r i)) lazily, isn't
possible with strict ranges, although it suggests further research.)
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"The art of doing mathematics consists in finding that special case
which contains all the germs of generality." --David Hilbert