Naming, compare function return values Panu A Kalliokoski (05 May 2005 16:16 UTC)
Re: Naming, compare function return values Jens Axel Søgaard (05 May 2005 17:37 UTC)
Re: Naming, compare function return values Panu Kalliokoski (08 May 2005 19:25 UTC)
Re: Naming, compare function return values Jens Axel Søgaard (08 May 2005 20:25 UTC)
Re: Naming, compare function return values Michael Sperber (16 May 2005 19:06 UTC)

Naming, compare function return values Panu A Kalliokoski 05 May 2005 16:16 UTC

Two things in this SRFI strike me as particularly "un-scheme-like" (for
my conception of scheme-like, with which you may agree):

(1) the names of compare functions are of the form compare-* rather than
*-compare.  The traditional Scheme way is to prefix with type, isn't it?
Why was this naming scheme adopted?

(2) the codomain of compare functions is {-1, 0, 1} which reminds me of
other (bad) programming languages where real enumerations are hard to
do.  While these values bear some intuitive semblance to orderings
(because of the sign function), the traditional Lisp/Prolog/ML way for
things like this are real descriptive values, in the case of Scheme, the
symbols {less, equal, greater} (or {lt, eq, gt}).  The only reason to
use the nondescriptive values is AFAIU the possibility to add and
multiply values produced from compare functions, which easily leads to
ugly code.  So, is there some kind of rationale for the codomain of
compare functions?

Panu Kalliokoski

--
personal contact: xxxxxx@iki.fi, +35841 5323835, +3589 85619369
work contact: xxxxxx@ling.helsinki.fi, +35850 3678003
kotisivu (henkkoht):	http://www.iki.fi/atehwa/
homepage (technical):	http://sange.fi/~atehwa/