From ed8c86364ed62066f5bcd6bb5fb68fff9d0e1a0f Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Sat, 9 Jan 1999 15:07:52 +0000 Subject: [PATCH] *** empty log message *** --- NEWS | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ RELEASE | 4 ++++ 2 files changed, 52 insertions(+) diff --git a/NEWS b/NEWS index 38b8889ec..4cda8f2fb 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,54 @@ in backtraces. * Changes to Scheme functions and syntax +** New function: sorted? SEQUENCE LESS? +Returns `#t' when the sequence argument is in non-decreasing order +according to LESS? (that is, there is no adjacent pair `... x y +...' for which `(less? y x)'). + +Returns `#f' when the sequence contains at least one out-of-order +pair. It is an error if the sequence is neither a list nor a +vector. + +** New function: merge LIST1 LIST2 LESS? +LIST1 and LIST2 are sorted lists. +Returns the sorted list of all elements in LIST1 and LIST2. + +Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal" +in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2}, +and that a < b1 in LIST1. Then a < b1 < b2 in the result. +(Here "<" should read "comes before".) + +** New procedure: merge! LIST1 LIST2 LESS? +Merges two lists, re-using the pairs of LIST1 and LIST2 to build +the result. If the code is compiled, and LESS? constructs no new +pairs, no pairs at all will be allocated. The first pair of the +result will be either the first pair of LIST1 or the first pair of +LIST2. + +** New function: sort SEQUENCE LESS? +Accepts either a list or a vector, and returns a new sequence +which is sorted. The new sequence is the same type as the input. +Always `(sorted? (sort sequence less?) less?)'. The original +sequence is not altered in any way. The new sequence shares its +elements with the old one; no elements are copied. + +** New procedure: sort! SEQUENCE LESS +Returns its sorted result in the original boxes. No new storage is +allocated at all. Proper usage: (set! slist (sort! slist <)) + +** New function: stable-sort SEQUENCE LESS? +Similar to `sort' but stable. That is, if "equal" elements are +ordered a < b in the original sequence, they will have the same order +in the result. + +** New function: stable-sort! SEQUENCE LESS? +Similar to `sort!' but stable. +Uses temporary storage when sorting vectors. + +** New functions: sort-list, sort-list! +Added for compatibility with scsh. + ** The range of logand, logior, logxor, logtest, and logbit? have changed. These functions now operate on numbers in the range of a C unsigned diff --git a/RELEASE b/RELEASE index 52aa8a717..58bd730da 100644 --- a/RELEASE +++ b/RELEASE @@ -12,6 +12,10 @@ In release 1.5: - remove names evalext.c: serial-map, ramap.c: serial-array-copy!, serial-array-map! +Modules sort.c and random.c should be factored out into separate +modules (but still be distributed with guile-core) when we get a new +module system. + Platforms for test builds: SunOS (gcc and pcc) --- galapas.ai.mit.edu Solaris (gcc and SUN cc) --- saturn.ai.mit.edu