Re: there is no correct way to use list-sort! or list-stable-sort!
Alex Shinn 12 Mar 2016 23:36 UTC
On Wed, Mar 9, 2016 at 9:31 PM, William D Clinger <xxxxxx@ccs.neu.edu> wrote:
>
> So long as I'm commenting on SRFI 132, let me state my opinion that its
> emphasis upon destructive operations is antiquated. With generational
> garbage collectors, it's entirely possible that each of the destructive
> operations allocates a transaction record needed to preserve invariants
> that allow garbage to be collected without scanning the entire heap.
> (Some generational collectors pre-allocate the storage needed for that
> meta-data, while some allocate it on the fly.) The SRFI's claim that
> destructive versions will run in constant space is therefore an empty
> promise.
As a counter-point, working with data-structures larger than
the remaining free memory is not such a rare thing, and being able
to sort them can be a nice feature. Linear update allows this as an
implementation possibility. The current semantics, as you note, are
simply broken.
--
Alex