On Fri, 5 Nov 2004, blake wrote:

> I am using cmucl 19a and possibly don't understand the use of sort.  It 
> appears to eliminate most of the list when using the #'< operator, e.g.
> * (setf a '(15.61d0 15.13d0 14.47d0 14.47d0 13.75d0 11.93d0))
> 
> (15.61d0 15.13d0 14.47d0 14.47d0 13.75d0 11.93d0)
> * (sort a #'<)
> 
> (11.93d0 13.75d0 14.47d0 14.47d0 15.13d0 15.61d0)
> * a
> 
> (15.61d0)

CMU CL's sort destructively modifies the original sequence. AFAIK this is 
allowed, but different from what e.g. CLISP does.

You might want to (sort (copy-seq ...)) to stay side-effect free.

-- 
regards,               [EMAIL PROTECTED]              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)

Reply via email to