« first day (341 days earlier)      last day (127 days later) » 

12:29 AM
My first preference would be for words, paths and words as map keys to be case sensitive (and hence consistent). If that is not the case, then I personally value word consistency above having case sensitive map keys.

For me, strings are different from words in one important aspect. As I understand words are internal in that there source is either program code or they are formed from a string processes by Rebol. In this sense, words are Rebol specific and can be "trusted" by a programmer (no need to validate them either mentally when coding or actually by checking that the conform to the e
Another difference to me is that, at least in English, the capitalisation of a letter conveys meaning to all users of the language. For example, it is clear that Rob is a person's name whereas rob is the act of stealing. (I guess it is the same in other languages which employ capitalisation).

I don't see the same with words in Rebol, there is no semantic difference between Copy and copy (well not to me). Though I can recognise that they are different.
So a programmer who is dealing with text needs to be wary of text data both in loading them into strings and using them.
 
12:49 AM
From my point of view, consistency in treatment of words has more value than in treatment of strings. My two reasons are: firstly, when programming using words is an almost sub-conscious process - you don't need to think you just type but you do need to consider aspects of a string such as capitalisation; and secondly, string handling already has inconsistencies (/case refinements for some functions but not others e.g. greater?).
So I wouldn't be unhappy if strings used as map! keys where case insensitive.
 
 
2 hours later…
3:05 AM
@PeterWAWood Following from your previous point, did you mean to say, “So I wouldn't be unhappy if strings used as map! keys where case sensitive.”?
 
 
2 hours later…
4:38 AM
Yes. I did mean case sensitive .. I shouldn't try to rush. Let me try properly:

"So I would't be unhappy if strings used as map! keys were case sensitive even if words were case insensitive"
 
 
3 hours later…
7:23 AM
@PeterWAWood Consistency is a high priority for me too. This is why I think that under the current scheme, the header words Red and Red/System should be case-insensitive, which they are currently not.
For me, the primary power of map! is in it's string! keys, but case-insensitivity renders that power useless in many (if not most) real-world situations.
Although I'm a big fan of consistency, I think that rendering a language useless just to stay consistent is the wrong choice of priorities.
I also think that if there is a need to choose between consistency and utility, it indicates a possible flaw in the underlying design you're trying to stay consistent to. I blame the everything-is-case-insensitive paradigm.
Here are the solutions I can think of right now:
1. Throughout the language, all word!s, string!s and char!s are case-sensitive.
This gives us full consistency and utility. This would be my first preference after #2. However it's quite radical and, as earl points out, the majority of rebolers would apparently not welcome this change.
2. Throughout the language, all words!s are case-insensitive and string!s and char!s are case-sensitive.
I see this as still consistent (since this is actually the behaviour I expected when I first used Rebol, thinking = had a bug until I discovered ==), however depending on how this is implemented, it could be perceived as inconsistent.
One possible way to achieve this might be if = were strict for string!s and relaxed for word!s. Then == would be strict for both, and something like ~ would be relaxed for both. Then, for example, select would use =, select/case (or select/strict) would use == while something like select/relaxed could use ~.
This could be seen as either more or less radical than #1. I personally think it's more in line with what Rebol is than #1.
3. All keys in map! are the case-sensitive exception.
This is probably the easiest to implement in the short term, and the easiest exception to teach if breaking consistency.
4. map!'s string! and char! keys are the case-sensitive exception.
This is a compromise to make word!s consistent, but not string!s and char!s. I would prefer this to #3. Unfortunately, it may be more awkward to implement. Depending on how awkward, we may as well be consistent with strings!s and char!s and go all the way with #2 which is a much better solution IMO. However, this is less radical.
5. Like hash! and block!, map! is case-sensitive for storage, but case-insensitive for lookup (by default).
Then which is chosen for adding and modifying keys with a :? I would want to be able to use this convenient syntax for case-sensitivity. Great care needs to be taken here, and additional proposals would have to be made to ensure that the advantages of map! over hash! are not compromised. I see too many opportunities to do this badly for it to be worthwhile. It may not be impossible, but there would be more problems to solve and decisions to make.
6. Throughout the language (including map! keys), all word!s, string!s and char!s are case-insensitive. This is not an acceptable solution since it poses the problem to be solved in the first place.
7. There are 2 datatypes: a case-sensitive strict-map!, and a case-insensitive relaxed-map! (names not important)
I think this is silly! The reason for a relaxed-map! is consistency, but the existence of a strict-map! breaks that consistency anyway. This has no advantage over #3, IMO.
8. map! has a case-sensitivity property.
The first problem I see for this is that it may de-simplify the literal syntax for map!. Which is the default? Is information lost for the other? Or are there 2 literal non-constructive notations? If so, then this is really just #7 again.
9. map! doesn't have word! keys, and all it's keys are case-sensitive.
In this scenario, if you want word! keys, use object!s. I haven't thought through the consequences of this one much.
Was I incorrect in any of my descriptions or reasoning?
Are there any other proposed solutions I've missed?
Of course, I wouldn't put it past DocKimbel and Sonny (or one of us) to come up with some brilliant alternative solution which we haven't considered yet.
My personal order of preference is #2 #1 #4 #3, and maybe #5.
 
8:18 AM
@WiseGenius I think that you and I have a very different understanding of consistency. For example, to me your option #2 would introduce undesirable inconsistency.
This simple function demonstrates the value of consistency:
f: func [container [block! object!] element [string! word!] ] [
   container/:element
]
print f [a 1 b 2 c 3] 'A
print f make object! [a: 1 b: 2 c:3] 'A
print f ["a" 1 "b" 2 "c" 3] "A"
 
8:40 AM
@WiseGenius What would be helpful is if you could frame your proposal on the Red Github Wiki so that it doesn't get lost in this chat.
 
@PeterWAWood You mean #2?
 
I think it would be good to include all your options initially.
 
9:11 AM
@PeterWAWood I was about to propose the same. :-)
 
@DocKimbel Oh good! Now I don't have to write it myself. ;P
 
10:04 AM
@WiseGenius No he meant that he was about to propose to add your proposal to the GitHub Wiki.
 
@PeterWAWood I know. I was trying to be funny.
 
@PeterWAWood Thanks!
 
10:18 AM
By the way, values of the char! are not handled on a case insensitive basis. The rationale for this is that they are not really characters but Unicode code points. (char! isn't the most appropriate name for these values.)
 
11:03 AM
@PeterWAWood Oh, didn't notice, since this doesn't seem to be the case for Rebol 3. This seems also true of Rebol 2?
How do you feel about this though, since it would break this pattern?
f: func [container [block! object!] element [char! string! word!] ] [
container/:element
]
print f [a 1 b 2 c 3] 'A
print f make object! [a: 1 b: 2 c:3] 'A
print f ["a" 1 "b" 2 "c" 3] "A"
print f [#"a" 1 #"b" 2 #"c" 3] #"A"
BTW, the example works when compiled, but when interpreted Red only prints the first line. The other 3 give the following errors:
*** Error: word 'A has no value
*** Error: invalid value in path!
*** Error: invalid value in path!
 
print f make object! [a: 1 b: 2 c:3] 'A - will work with the latest commit of Red
print f ["a" 1 "b" 2 "c" 3] "A"
print f [#"a" 1 #"b" 2 #"c" 3] #"A"

appear to be bug. I will investigate.
@WiseGenius I'm happy with it for code points. I think that there is still a lot of thinking needed about what to do about characters. Perhaps, we need to change to the use of single byte strings for characters or, even better, introduce a genuine character type that would be used to hold grapheme clusters.
 
11:27 AM
So currently, word!s and string!s are handled the same way by =, but char! is handled differently.
Under #2, it would be word!s which is special, and string! and char! which are consistent.
 
I'm sure that @dockimbel will make a considered, pragmatic choice though I don't know how much he will be influenced by his new surroundings where, as far as I can tell, letters have no case and they all fit into a single code point.
It really would be better if you could update the proposal and make your case there .
 
I don't map being special, if it is clearly stated in Docs ...
 
@DocKimbel The following code compiles and runs successfully but gives errors in the console.
Red[]

b: ["a" "b" "c" "d" "e"]
s: "a"
print b/:s
bc: [#"a" #"b" #"c" #"d" #"e"]
c: #"a"
print bc/:c
red>> b: ["a" "b" "c" "d" "e"]
== ["a" "b" "c" "d" "e"]
red>> s: "a"
== "a"
red>> print b/:s
*** Script error: string type is not allowed here
*** Where: print
red>> bc: [#"a" #"b" #"c" #"d" #"e"]
== [#"a" #"b" #"c" #"d" #"e"]
red>> c: #"a"
== #"a"
red>> print bc/:c
*** Script error: char type is not allowed here
*** Where: print
Would you like me to open an issue?
 
11:46 AM
in above - I don't mind map being a special case ... if stated in Docs ...
 
 
3 hours later…
2:32 PM
@earl If there is any voting possible, I'm for case-sensitive map! as well! The main purpose why to use special datatype as map! is speed and case-insensitive checks will slow things down.
I probably don't care if word! keys would be case-insensitive, because using words for keys (in huge datasets) is not good idea anyway.
 
 
3 hours later…
5:36 PM
@PeterWAWood If that was the rationale, it was rethought. Chars are case insensitive in R3.
>> #"a" = #"A"
Oops, no RebolBot!
I posted it to the Rebol chat. Trust me, they are equal.
 
 
1 hour later…
6:54 PM
@Oldes Pro case sensitive map! too. My concern is I want to be able to take a base 64 string as key and those beasts contain both upper and lower case with different meaning.
 
 
3 hours later…
9:38 PM
@MarkI Char has always been case insensitive in Rebol 3. It is case sensitive in Red for the reasons I have explained.
 
@PeterWAWood Ooh, okay. Is there a rationale for chars case-sensitivity in R2? Or is that just a bug that is fixed in R3?
 
@MarkI That is a question that I cannot answer though it is unlikely to be a bug. There may be people in a Rebol forum who can answer that question.
In Red char! represents a Unicode code point in the range 00h to 10FFFFh. This is different from both Rebol2 and Rebol3.
@Oldes @iArnold There is a proposal for case insensitive map! keys in the Red wiki on Github that @dockimbel will consider when finalising the implementation of map! in Red. If you would like your voices to be heard, it would be better to add your suggestions and comments to the wiki article as he is unlikely to search through this chat when making the decision.
 
10:10 PM
@PeterWAWood Thanks. I've asked in the Rebol room ...
 
10:41 PM
With regard to proposals about case sensitive map! keys:

People seem to be focussing only on the impact on map! and not on the total impact of such a decision. For example, if map! keys were case sensitive and when word!, path! and string! are not, what is the impact on SELECT? How do you update the Docstring to explain that the function works differently when applied to a map! value?
 

« first day (341 days earlier)      last day (127 days later) »