Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!phri!roy From: roy@phri.UUCP (Roy Smith) Newsgroups: comp.lang.lisp Subject: what does "destructively sorted" mean in KCL? Message-ID: <3916@phri.UUCP> Date: 4 Aug 89 16:04:43 GMT Organization: Public Health Research Institute, NYC, NY Lines: 27 I'm trying to figure out how the sort function works in KCL, but I think I'm getting hung up on what "Common Lisp: The Language" means when it says in section 14.5: "The sequence is destructively sorted". I took "destructively sorted" to mean "sorted in-place", but it looks like it really means "trashed, but a sorted copy is returned". For example: >(setq foo '(1 3 9 4 -2 0 9)) (1 3 9 4 -2 0 9) >foo (1 3 9 4 -2 0 9) >(sort foo #'>) (9 9 4 3 1 0 -2) >foo (1 0 -2) Sort returns a sorted list as its value, but the argument gets trashed. Is this really the way it's supposed to work? Do I have to do (setq foo (sort foo #'>)) to get it to work? -- Roy Smith, Public Health Research Institute 455 First Avenue, New York, NY 10016 {att,philabs,cmcl2,rutgers,hombre}!phri!roy -or- roy@alanine.phri.nyu.edu "The connector is the network"