Type | Bug | Status | reviewed | Date | 13-Sep-2014 15:21 |
---|---|---|---|---|---|
Version | r3 master | Category | Datatype | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
Summary | SORT is not case-insensitive by default |
---|---|
Description |
Rebol 2 has a case-insensitive sort. >> sort "ABCabcdefDEF" == "AaBbCcdDeEfF" Consistent with the rest of Rebol canon, you must use a refinement to get sensitivity: >> sort/case "ABCabcdefDEF" == "ABCDEFabcdef" Rebol3 does not stick to the pattern. >> sort "ABCabcdefDEF" == "ABCDEFabcdef" Whether Rebol should be case-sensitive or not by default when dealing with strings is controversial, but... that argument may be unwinnable. I've mentioned my own thought on that matter as: " The need to use == instead of = to get case sensitive comparison, and instruct the primitives to use it with a refinement (e.g. SORT/CASE instead of SORT) is a choice that leads to grumbling from some in the Rebol and Red community. From a hardware point of view, it's kind of like "a" is "A" - handling uppercase specially being the exception and not the rule. I've theorized that if keyboards had 52 letters Rebol would be case-sensitive by default, and if you had to push shift to get a [ and didn't for a { it would use curly braces for code blocks..." And we have other questions about FIND and BITSET and if FIND should honor the /CASE refinement when dealing with bitsets. PARSE in Rebol3 does. It's a little tough when I don't necessarily completely support the idea that "HoStiLeFoRK" = "HOSTILEFORK" in the first place. But... that aside... Even those supporting the idea that BITSET testing should be unique think this SORT issue is a bug. SORT should be case-insensitive without a /CASE refinement. |
Example code |
Assigned to | n/a | Fixed in | - | Last Update | 21-Oct-2014 17:38 |
---|
Comments | |
---|---|
(0004525)
BrianH 21-Oct-2014 17:38 |
This is a bug, not a design change. SORT is supposed to be case-insensitive by default. There's a separate bug (in another ticket) for SORT completely ignoring its /case option at the moment. |
Date | User | Field | Action | Change |
---|---|---|---|---|
21-Oct-2014 17:38 | BrianH | Description | Modified | - |
21-Oct-2014 17:38 | BrianH | Category | Modified | Unspecified => Datatype |
21-Oct-2014 17:38 | BrianH | Status | Modified | submitted => reviewed |
21-Oct-2014 17:38 | BrianH | Comment : 0004525 | Added | - |
13-Sep-2014 15:21 | fork | Ticket | Added | - |