Re: the sort function in lisp (destructive)
- From: Gene <gene.ressler@xxxxxxxxx>
- Date: Sun, 6 Jan 2008 13:20:31 -0800 (PST)
On Jan 6, 2:23 pm, Kent M Pitman <pit...@xxxxxxxxxxx> wrote:
"John Thingstad" <jpth...@xxxxxxxxx> writes:Another possible reason is to avoid a certain kind of degenerate cache/
På Sun, 06 Jan 2008 17:38:04 +0100, skrev Rainer Joswig <jos...@xxxxxxx>:
Another alternative would be a SORT that does not reorder
the CONS cells, ...
In fact looking at the source for Corman Lisp I discovered that it
reads the CAR into a vector, sorts that, and then puts the values
back in the CAR's in sorted order.
This might have been done for other reasons than avoiding side-effect.
For example, to avoid having two different sort algorithms, or even
because it didn't occur to him how to write the algorithm without
doing indexed access.
paging behavior. If you sort a long, randomly ordered list by
changing cdr's, merely traversing the resulting list cells makes for a
terrible memory access pattern.
.
- Follow-Ups:
- Re: the sort function in lisp (destructive)
- From: Madhu
- Re: the sort function in lisp (destructive)
- References:
- Re: the sort function in lisp (destructive)
- From: Alex Mizrahi
- Re: the sort function in lisp (destructive)
- From: Rainer Joswig
- Re: the sort function in lisp (destructive)
- From: John Thingstad
- Re: the sort function in lisp (destructive)
- Prev by Date: Re: the mars rover runs lisp?
- Next by Date: Re: the sort function in lisp (destructive)
- Previous by thread: Re: the sort function in lisp (destructive)
- Next by thread: Re: the sort function in lisp (destructive)
- Index(es):
Relevant Pages
|