World: r3wp
[!REBOL3 Proposals] For discussion of feature proposals
older newer | first last |
Andreas 20-Jan-2011 [700] | For reference, also be aware that we have operator shortcuts for the comparison functions. At the moment: =: equal? (and != ==: strict-equal? (and !==) =?: same? The == operators should then probably become shortcuts for strict-equiv. |
BrianH 20-Jan-2011 [701] | That's a bigger problem than binding, believe me. Exact decimal comparison makes floating point code nearly unusable by normal programmers. |
Andreas 20-Jan-2011 [702x2] | As mentioned above, that's perfectly fine with me. |
It's not decimal precision which makes the FIND (and STRICT-MAP!) discussion so cumbersome. | |
BrianH 20-Jan-2011 [704x3] | We don't need operators for the equiv branch. STRICT-EQUIV? and SAME? are the same thing for words and decimals. |
If you want I can write up your reshuffled hierarchy as a CC ticket. I think Carl would like it, ans the binding issue has bit him in the past. | |
ans -> as | |
Andreas 20-Jan-2011 [707x2] | Thanks for your input. I'll also wait for Ladislav's input at least, as the "Comparisons" doc was authored by him. |
So let's update this with the decimal precision moved: - equal? - strict-equal?: equal + type + case + alias - equiv?: equal + binding + decimal - strict-equiv?: equiv + type + case + alias - same?: as currently | |
BrianH 20-Jan-2011 [709x2] | Strangely enough, it's not binding or exact decimal comparison that are at issue with FIND or strict-map! either, it's case and type. Nonetheless, this would make it easier to point to the distinction between STRICT-EQUAL? and STRICT-EQUIV? when talking about those, precisely because those aren't at issue. |
Sounds good to me. | |
Andreas 20-Jan-2011 [711] | As you see, case and type are the major distinction between equal and strict-equal. |
BrianH 20-Jan-2011 [712] | Yup. That makes sense. |
Andreas 20-Jan-2011 [713x2] | So that would make it easy to define FIND as using EQUAL? per default, and STRICT-EQUAL? with /case. |
(Or a renamed /case option. A bit hypothetical due to backwards compatibility, but mentioning it for the sake of completeness.) | |
BrianH 20-Jan-2011 [715x2] | We can't rename the /case option - legacy naming rules. And if the equivalences are reshuffled this way, we won't have to. |
Andreas, the proposal has been added here: http://issue.cc/r3/1834 - if you have any suggestions or tweaks, mention them here or there and I'll update it. | |
Andreas 20-Jan-2011 [717x2] | Yes, I have a suggestion: my explicit wish was to wait with this for Ladislav's feedback. |
Please respect that in the future. | |
BrianH 20-Jan-2011 [719x2] | I put in a request for Ladislav's feedback in a ticket comment, and in other AltME worlds where he works. Including the RMA world, where they write code that would be affected by this. |
Unlike here, tickets can be tweaked based on feedback. We needed a baseline to start with. | |
Andreas 20-Jan-2011 [721x2] | Unlike here, extensive CC discussions are a mess. |
Edit "no aliasing" to "alias distinctions". Thanks. | |
BrianH 20-Jan-2011 [723x2] | They're a mess here too, but are more useless because they can't be searched as easily once they drop off the history, and the relevant people who would make the changes aren't generally here that much.. CC is a much better place for this kind of thing. |
Actually, no aliasing is more correct than what is on the wiki. | |
Andreas 20-Jan-2011 [725x2] | equal plus no aliasing is bad wording. |
And it's really simple: I wanted Ladislav's feedback here first, before we write up a ticket and litter it with useless comments. Again, please respect that in the future. | |
BrianH 20-Jan-2011 [727x2] | OK. |
Case-insensitivity is implemented using aliasing. Case sensitivity means that the aliases are ignored - no aliasing. | |
Andreas 20-Jan-2011 [729x5] | Case sensitivity does not mean that aliases are ignore. |
At least I don't know of a way off hand to prove that. | |
But I trust you that word case sensitivity is implemented using aliases. | |
But to me, "equal plus no aliasing" still does not clearly express whether aliased words are considered to be equal or ignored in this case. | |
equal or different* | |
BrianH 20-Jan-2011 [734] | Fortunately it can be edited (and I will do that now). |
Andreas 20-Jan-2011 [735x2] | Equal plus alias distinction was clearer to me. |
(As not all aliases are case related.) | |
BrianH 20-Jan-2011 [737] | Actually, that feature might go away. The ALIAS function has been a big hassle in R3 because of the lack of a central system/words repository. We are likely to keep the aliasing facility for internal use to implement case insensitivity, but the ALIAS function to do other kinds of aliasing may go away. |
Andreas 20-Jan-2011 [738] | Yes, I am aware of that. |
BrianH 20-Jan-2011 [739] | Oh good :) |
Andreas 20-Jan-2011 [740] | But as of A110, we still have it :) So to formulate the wish on that basis, we need to take it into account, or someone else will hassle us about having left out alias. |
BrianH 20-Jan-2011 [741] | Yup. Working on the wording now. I think the semantics of the proposal are good though. |
Andreas 20-Jan-2011 [742] | Just keep it short, though. |
Ladislav 20-Jan-2011 [743x2] | >> equal? -0. 0. == true >> equiv? -0. 0. == true >> strict-equal? -0. 0. == true >> same? -0. 0. == false |
(I suppose, that is one thing Brian wanted to know) | |
BrianH 20-Jan-2011 [745] | Good to know. How would it affect numeric code if we made this change? Do we need operators for exact comparison? |
Ladislav 20-Jan-2011 [746] | numeric code - I do not think this specific property can affect anything |
BrianH 20-Jan-2011 [747] | We don't use denormalized numbers or anything like that which would make numbers with different bit patterns refer to the same number? |
Ladislav 20-Jan-2011 [748] | I am not sure I understand your question. Nevertheless, the least strict is currently Equal?, which, most probably, is useful. The most strict (for numeric code using decimals) that we could need is Equiv? The Same? is is important only because it is the most strict possible |
Andreas 20-Jan-2011 [749] | I think the real question is: we also have strict-equal? which is (IIUC) as strict as equiv? for numeric code using decimals _and_ is also mapped to operators: == and !==. |
older newer | first last |