Bug in Sort !?!?
- To: mathgroup at smc.vnet.net
- Subject: [mg126949] Bug in Sort !?!?
- From: James Stein <mathgroup at stein.org>
- Date: Tue, 19 Jun 2012 03:16:58 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
The documentation says: "Sort orders strings as in a dictionary, with
uppercase versions of letters coming after lowercase ones." It is
therefore unsurprising that { "3", "4", "4b" } are already sorted.
But who can correctly predict the three True/False values produced by
the six lines below? (And who can explain it?)
s={"3","4","4b"};
Sort[s] == s
s=Map[StringJoin[#,"."]&,s];
Sort[s] == s
s=Map[StringJoin[#,"nb"]&,s];
Sort[s] == s