kleopatra999 / owl-lisp

Automatically exported from code.google.com/p/owl-lisp
3 stars 1 forks source link

Case-insensitive mappings #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
R7RS makes string=? (and friends) system-dependent, but requires string-ci=? 
(and friends) to work like a composition of string-foldcase with (string=? and 
friends).  String-foldcase in turn is defined to use Unicode's full case 
folding.

Full case folding isn't actually that hairy: basically, there are 1022 
characters that are folded to a single character, 88 characters that are folded 
to a sequence of two characters, and 15 characters that are folded to a 
sequence of three characters.  See 
http://www.unicode.org/Public/6.0.0/ucd/CaseFolding.txt , ignoring the S and T 
entries.

Original issue reported on code.google.com by johnwco...@gmail.com on 21 Dec 2011 at 12:37

GoogleCodeExporter commented 9 years ago
That doesn't sound too bad.

Original comment by aohelin on 21 Dec 2011 at 9:39

GoogleCodeExporter commented 9 years ago
Added a rule to Makefile to autogenerate a char mapping based on 
http://www.unicode.org/Public/6.0.0/ucd/CaseFolding.txt and lib-string now 
exports a unicode-fold-char :: codepoint tail -> (codepoint' ... tail) as in

$ bin/vm fasl/bootp.fasl 
You see a prompt
> (list->string (foldr unicode-fold-char null (string->list 
"0123456789abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ 
Λλ Ππ Αα Ββ Θθ Ωω Φφ")))
0123456789abcdefghijklmnopqrstuvwxyzåäöabcdefghijklmnopqrstuvwxyzåäö λλ 
ππ αα ββ θθ ωω φφ

which can be used for the case insensitive comparisons if it seems to work 
properly. I'll have a better look in the evening.

Thanks for pointing this out, and in general for the good bug reports :)

Original comment by aohelin on 21 Dec 2011 at 10:20

GoogleCodeExporter commented 9 years ago
Added -ci comparisons using case folding mentioned above. I'm closing this bug 
since a case-insensitive mapping is now added and also used for the 
comparisons, but adding string-(fold|up|down)case separate todo items for the 
upcoming R7RS feature addition pass.

Original comment by aohelin on 23 Dec 2011 at 7:41