Re: Question about the sort function
- From: skibud2 <mike.halloran@xxxxxxxxx>
- Date: Tue, 09 Oct 2007 14:51:55 -0000
So, I never claimed to have 10 years of experience (in case any of you
were wondering). For some reason I had the impression that calling
sort on a list left the list as a sorted list; Clisp & SBCL does this,
but it is not standard Common Lisp. I am very familiar with lisp and I
use many languages. Sadly enough, my memory is not infinite and I
sometimes forget the details. Let's just say, I won't forget this
detail about sort from now on. ;)
However wrong I was, I am the type of person that will not change my
solution without understanding the reasoning. Changing sort to stable-
sort would have made the problem work, but it was the wrong answer.
That is the reason I posted this question on the user group. The
reviewer may have been annoyed with the fact that I was challenging
his requested fix, but the fact is: his fix was incorrect. I always
assumed there was something I was doing wrong, but I was pretty sure
it had nothing to do with stable-sort vs sort.
Well damn, that is one out of ten lisp jobs that I cannot apply to
anymore. Oh well. Next time I will just agree and figure it out later.
PS. I am really not a difficult person, although I sure feel like one
right now.
On Oct 9, 10:12 am, w...@xxxxxxxxxxxxxxx (Bob Felts) wrote:
Rainer Joswig <jos...@xxxxxxx> wrote:
In article <1i5ow53.pskscln5nqbmN%w...@xxxxxxxxxxxxxxx>,
w...@xxxxxxxxxxxxxxx (Bob Felts) wrote:
...
Even for Common Lisp? The Hyperspec is clear that sort and stable-sort
are destructive. Maybe I'm being naive...
It is not intuitive (at least for me) that one sorts a list
and the variable pointing to that list is not updated
to point to the sorted list. It is a consequence of
Lisp evaluation rules an the type of lists (made of cons cells)
it uses, but may not clear for somebody
who also uses programming languages where you
can pass variables differently or lists are implemented differently.
It is a typical topic for a Common Lisp tutorial explaining
how destructive list operations should be used.
Well, even if the behavior of sort isn't intuitive (and I'm not arguing
that it is), shouldn't someone with 10 years of Lisp experience have
learned its behavior by then? I tend to think yes; Kent made an
argument that this might not be the case even with a good programmer.
I'm interested in other viewpoints. It seems to me that good artists
have to be familiar with their tools, and the more experienced claimed,
the better the familiarity. But, perhaps we agree on principle, but
aren't sure where to actually draw the line.
.
- Follow-Ups:
- Re: Question about the sort function
- From: Don Geddis
- Re: Question about the sort function
- From: Chris Russell
- Re: Question about the sort function
- References:
- Question about the sort function
- From: skibud2
- Re: Question about the sort function
- From: Barry Margolin
- Re: Question about the sort function
- From: skibud2
- Re: Question about the sort function
- From: skibud2
- Re: Question about the sort function
- From: Barry Margolin
- Re: Question about the sort function
- From: skibud2
- Re: Question about the sort function
- From: Rainer Joswig
- Re: Question about the sort function
- From: skibud2
- Re: Question about the sort function
- From: Rainer Joswig
- Re: Question about the sort function
- From: Bob Felts
- Re: Question about the sort function
- From: Kent M Pitman
- Re: Question about the sort function
- From: Bob Felts
- Re: Question about the sort function
- From: Rainer Joswig
- Re: Question about the sort function
- From: Bob Felts
- Question about the sort function
- Prev by Date: Re: Hello
- Next by Date: Re: Flamebait if I ever saw it
- Previous by thread: Re: Question about the sort function
- Next by thread: Re: Question about the sort function
- Index(es):
Relevant Pages
|
|