Re: String comparison under Latin-1 and Unicode
Sergei Egorov 10 Mar 2000 20:35 UTC
I am not sure if it's a good idea to use strings ("<", "<=", or "=")
as ordering arguments; symbols are better but I think the Scheme
way is to use first-class functions if they do the trick:
(collation->string< language-specifier) -> pred?
(collation->string<= language-specifier) -> pred?
(collation->string> language-specifier) -> pred?
(collation->string>= language-specifier) -> pred?
(pred? string1 string2) -> bool
In addition, the user still should have access to
string->collation-key and collation key comparison
procedures to avoid costly collation key recalculations
in search, sorting, etc.
Sergei
----- Original Message -----
>From: Dave Mason <xxxxxx@sarg.ryerson.ca>
To: <srfi-13@srfi.schemers.org>
Sent: Friday, March 10, 2000 3:06 PM
Subject: Re: String comparison under Latin-1 and Unicode
> Sorry, I sent this prematurely!
>
> >>>>> On Fri, 10 Mar 2000 15:00:16 -0500, Dave Mason
<xxxxxx@sarg.ryerson.ca> said:
>
> > I would much prefer either:
> > (collation->predicate language-specifier ordering) -> pred?
> > (pred? string1 string2) -> bool
>
> and then didn't give the or:
> (collation->predicate language-specifier) -> pred?
> (pred? ordering string1 string2) -> bool
>
> (though I prefer the first version)
>
> > where LANGUAGE-SPECIFIER is as Ben Goetter
> > <xxxxxx@angrygraycat.com> suggested and ORDERING is one of the
> > strings "<", "<=", or "="
>
> > This seems far more useful, and efficient that converting any string
> > you want to compare to a collation-key!
>
> ../Dave
>