Subject: Re: Lisp is *SLOW*
From: Erik Naggum <erik@naggum.no>
Date: 1997/07/22
Newsgroups: comp.lang.lisp,comp.programming,comp.lang.c++
Message-ID: <3078520173470566@naggum.no>


* Marco Antoniotti
| If we want, we could discuss at length why some of the design choices
| of "destructive" operations in Common Lisp sometime have a
| non-intuitive behavior.

do they?  the question is one of which value one looks at, I think.  `sort'
on a list returns a sorted list, but the cons cells that used to be that
list have been reused.  if we look at the return value of `sort', we get
the sorted list.  if we look at a random cons cell that has been reused in
some unspecified way, who's to tell?  like `nreverse' in one implementation
swaps the `car' of cons cells, and in another the `cdr', we cannot know
what a cons cell that has been destructively modified would contain, unless
the operation is specified by the specification of the language, and it
isn't for `sort' or `nreverse'.

or, another way: after (sort <list> <predicate>), <list> is _history_.

#\Erik
-- 
there was some junk mail in my mailbox.  somebody wanted to sell me some
useless gizmo, and kindly supplied an ASCII drawing of it.  "actual size",
the caption read.  I selected smaller and smaller fonts until it vanished.