Type | Bug | Status | reviewed | Date | 25-Aug-2014 23:50 |
---|---|---|---|---|---|
Version | r3 master | Category | Datatype | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
Summary | FIND is not case-insensitive by default on BITSET |
---|---|
Description |
Parse in Rebol3 is case insensitive on characters by default, so this returns true: parse "abc" [some [#"A" | #"B" | #"C"]] Unlike Rebol2 it has been adjusted to be case-insensitive if you wrote the same thing using charsets. So you also get true back from: c: charset [#"A" #"B" #"C"] parse "abc" [some c] This is a consistent change and is good (assuming you buy into the idea that Rebol being case-insensitive by default on string and character comparisons is a good thing, which is not agreed on by everyone.) However, FIND of a character is not passing the case sensitivity: >> find charset [#"A" #"B" #"C"] #"a" == none Contrast with handling if that had been a block of characters >> find [#"A" #"B" #"C"] #"a" == [#"A" #"B" #"C"] |
Example code |
; Current behavior: >> find charset [#"A" #"B" #"C"] #"a" == none >> find/case charset [#"A" #"B" #"C"] #"a" == none ; Desired behavior: >> find charset [#"A" #"B" #"C"] #"a" == true >> find/case charset [#"A" #"B" #"C"] #"a" == none |
Assigned to | n/a | Fixed in | - | Last Update | 21-Oct-2014 18:18 |
---|
Comments | |
---|---|
(0004529)
BrianH 21-Oct-2014 18:18 |
Sounds good, as long as we limit the case-insensitivity to finding char! and string! values, not finding integers or finding anything in binaries. When you are finding chars and strings, case-insensitivity is a thing, so it makes sense to be consistent with the rest of Rebol. But when finding integers, case is not a thing, and we should be sure to not make it a thing. |
Date | User | Field | Action | Change |
---|---|---|---|---|
5-Mar-2015 16:21 | BrianH | Comment : 0004529 | Modified | - |
5-Mar-2015 16:19 | BrianH | Comment : 0004529 | Modified | - |
21-Oct-2014 18:18 | BrianH | Description | Modified | - |
21-Oct-2014 18:18 | BrianH | Code | Modified | - |
21-Oct-2014 18:18 | BrianH | Category | Modified | Unspecified => Datatype |
21-Oct-2014 18:18 | BrianH | Status | Modified | submitted => reviewed |
21-Oct-2014 18:18 | BrianH | Comment : 0004529 | Added | - |
25-Aug-2014 23:50 | Fork | Ticket | Added | - |