Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!oliveb!sun!basselope!shiffman From: shiffman%basselope@Sun.COM (Hank Shiffman) Newsgroups: comp.lang.lisp Subject: Re: Kyoto Common LISP bug (SORT function) Keywords: bugs, bugs, bugs Message-ID: <56159@sun.uucp> Date: 10 Jun 88 22:12:38 GMT References: <10988@cgl.ucsf.EDU> Sender: news@sun.uucp Reply-To: shiffman@sun.UUCP (Hank Shiffman) Organization: Sun Microsystems, Mountain View Lines: 22 In article <10988@cgl.ucsf.EDU> yee@cgl.ucsf.edu (dave yee) writes: >The problem is with sort and stable-sort. Suppose >i have a structure of the following form: > >now, given a list of boxes, i would like to sort them by item-code number. >for example, > > (setq sorted-boxes (sort unsorted-boxes #'< :key'box-item-code)) Sort and stable-sort are destructive of the original list. That's mentioned in the first line of the description in Steele. Try invoking sort on (copy-list unsorted-boxes) instead of unsorted-boxes. ---- Hank Shiffman (415) 336-4658 AI Product Marketing Technical Specialist shiffman@Sun.COM Sun Microsystems, Inc. ...!sun!shiffman "Hanging its lawyers might not correct all of this country's woes but it would be lots of fun and could do no harm to anyone." - Robert Anson Heinlein quoting Samuel Langhorn Clemens