r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 Proposals] For discussion of feature proposals

Steeve
15-Jan-2011
[679x2]
recycle/ballast avoid the "stop the world" issue if well balaned
*balanced
Andreas
20-Jan-2011
[681]
How about a minor addition to/restructuring of the comparison functions:
- equal?
- equiv?: equal + binding

- strict-equal?: equal + type + case + alias + decimal  (but _no_ 
binding)
- srict-equiv?: strict-equal + binding
- same?: as currently


(See http://www.rebol.net/wiki/Comparisons#EQUAL.3Ffor the status 
quo.)
BrianH
20-Jan-2011
[682]
Alias?
Andreas
20-Jan-2011
[683x2]
See the referenced document.
strict-* makes alias distinctions.
BrianH
20-Jan-2011
[685]
Oh, right. All words are aliased. That's how case insensitivity is 
implemented in R3. So case = alias for words.
Andreas
20-Jan-2011
[686x4]
maybe alias implies case, but case does not imply alias.
What we seem to be missing at the moment is a comparison function 
with ignores binding but is otherwise "strict" in the sense of type/case/alias/decimal 
precision.
If we had such a function, the discussion around #1830 and related 
issues (such as a more useful map! type) would be much easier.
The proposal above now is to have equal/strict-equal not respect 
binding, and have equiv/strict-equiv be their binding-respecting 
counterparts.
BrianH
20-Jan-2011
[690x2]
The original purpose of EQUIV? was the decimal thing, so you might 
want to move it there.
#1830 doesn't actually use STRICT-EQUAL?, so reordering the hierarchy 
won't help. You need to see the new 1830.
Andreas
20-Jan-2011
[692x4]
That's the whole point of this proposal.
With the above strict-equal, it could safely use it.
Either in the default case, or with a /case, /strict or /whatever 
refinement.
Framed this way, this discussion would be a lot easier, imo; and 
probably more fruitful.
BrianH
20-Jan-2011
[696]
That is a seperate issue that needs its own ticket. FIND and SELECT 
use their own code, so they can only follow the same rules, not use 
the same code.
Andreas
20-Jan-2011
[697]
That is an implementation problem, not a design issue
BrianH
20-Jan-2011
[698]
I am OK with a DAG for the equivalences, but would prefer the exact 
decimal comparison to go in the EQUIV?, STRICT-EQUIV? branch.
Andreas
20-Jan-2011
[699x2]
Fine with me, but most likely only a minor issue.
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.