Re: Eliminate numeric-range over inexact numbers?
Wolfgang Corcoran-Mathe 30 Aug 2020 21:08 UTC
Additional note: The O(n) space complexity of the "vectorizing"
range-map is actually its worst aspect, I think. This violates the
compact nature of ranges, as the entire range must be realized as a
vector which is then enclosed in a new range:
(range-map square (numeric-range 0 10000))
==
(vector->range (vector-map square #(0 ... 9999)))
So we can no longer rely on the crucial principle stated near the
beginning of SRFI 196: "The size of a range object is independent of
the number of elements it contains".
(Apologies for replying to myself.)
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"The usual way in which we plan today for tomorrow is in
yesterday's vocabulary." --Edsger W. Dijkstra