range->vector Marc Nieper-Wißkirchen (01 Sep 2020 11:29 UTC)
Re: range->vector John Cowan (01 Sep 2020 15:29 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 15:45 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (01 Sep 2020 16:33 UTC)
Re: range->vector John Cowan (01 Sep 2020 17:12 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 17:27 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (01 Sep 2020 17:34 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 17:36 UTC)
Re: range->vector Arthur A. Gleckler (01 Sep 2020 17:37 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 17:38 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (01 Sep 2020 17:46 UTC)
Re: range->vector John Cowan (01 Sep 2020 18:23 UTC)
Re: range->vector Arthur A. Gleckler (01 Sep 2020 18:40 UTC)
Re: range->vector John Cowan (01 Sep 2020 18:42 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 18:52 UTC)
Re: range->vector Marc Nieper-Wißkirchen (01 Sep 2020 19:22 UTC)
Re: range->vector John Cowan (03 Sep 2020 00:15 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (03 Sep 2020 02:27 UTC)
Re: range->vector John Cowan (03 Sep 2020 03:35 UTC)
Re: range->vector Marc Nieper-Wißkirchen (03 Sep 2020 06:47 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (03 Sep 2020 18:04 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (03 Sep 2020 18:27 UTC)
Re: range->vector Marc Nieper-Wißkirchen (03 Sep 2020 19:10 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (03 Sep 2020 20:32 UTC)
Re: range->vector Wolfgang Corcoran-Mathe (03 Sep 2020 07:11 UTC)
Re: range->vector Marc Nieper-Wißkirchen (03 Sep 2020 07:14 UTC)

Re: range->vector Marc Nieper-Wißkirchen 03 Sep 2020 07:14 UTC

Am Do., 3. Sept. 2020 um 09:11 Uhr schrieb Wolfgang Corcoran-Mathe
<xxxxxx@sigwinch.xyz>:

[...]

> A thought: What do you think about keeping the indexer-composing
> version in the two-range case of range-append?  e.g.
>
>     (define range-append
>       (case-lambda
>        ; ...
>        ((ra rb)                            ; two-range fast path
>         (let ((la (range-length ra))
>               (lb (range-length rb)))
>           (raw-range 0
>                      (+ la lb)
>                      (lambda (i)
>                        (if (< i la)
>                            (range-ref ra i)
>                            (range-ref rb (- i la)))))))
>        ; ...
>        ))
>
> This indexer is O(1) on its own, and successive two-range appends
> would, in essence, build a binary search tree associating indices with
> ranges.
>
> The variadic case would still return a vector-style range.

That idea is not sufficient if you add successively add one-element
ranges with range-append.

Please see my other post for a general solution.