emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cl.el sort* efficiency


From: Kevin Ryde
Subject: Re: cl.el sort* efficiency
Date: Sun, 24 Dec 2006 11:56:20 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

"Juanma Barranquero" <address@hidden> writes:
>
> You're implementing a Schwartzian Transform
> (http://en.wikipedia.org/wiki/Schwartzian_transform) inside sort*,
> which is kinda odd.

The concept would pre-date 1994, wouldn't it?  (Not that this is the
place for questions of academic priority :-)

> IMHO is the responsibility of the user of sort* to know whether
> comparisons are going to be expensive and preprocess the data to help
> in the comparison.

A key func as data accessor seemed to me a reasonably natural way to
express that, but maybe that's just me.

> You're doing an optimization at the wrong level:
> perhaps I'm using it with so light a comparison function that your
> method makes it more expensive...

I see the common lisp spec specifically doesn't say how much or little
the key is used.  Dunno what you get from implementations in practice.
Is there a CL expert in the house?


In any case Richard advises not doing anything to emacs at this time,
but I would propose a sentence for the manual, just to describe what's
current.

2006-12-24  Kevin Ryde  <address@hidden>

        * cl.texi (Sorting Sequences): In sort*, add a little cautionary note
        about the key procedure being used heavily.

Attachment: cl.texi.sort-key.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]