[Glass] [3.4.0] Strange behaviour with indices ...

monty via Glass glass at lists.gemtalksystems.com
Tue Mar 20 02:17:23 PDT 2018

Dale, you're busy, but did you read the whole String>>#= thread? This:
| one two |
one := 'Köln'.
two :=  String with: $K with: $o with: 16r308 asCharacter with: $l with: $n.
one = two
	and: [one hash ~= two hash]

is absolutely a bug, not just a surprise. To be consistent with #=, String>>#hash must normalize (with UCI) its string before computing its hash.

(IMO #=, #<=, etc doing implicit normalization before comparing was a mistake. Either the Java/C# way of making the user manually normalize the strings before comparing or the Perl6 way of storing strings internally in a pre-normalized form would have been more intuitive and consistent. I assume it's too late to change now.)

More information about the Glass mailing list