-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IS/ISN'T Step 1: temp. remove = != <> EQUAL? NOT-EQUAL? #873
Conversation
This really implies a lot of changes in daily used code. :-/ |
Given that practically all uses of = in the tests really meant == and the same may be true for most other code ... how about just making the change in one step? Random thought of the day: |
Sure that has been yet considered ... but why not |
As with other changes (like // for comments), it's an important thing that has had a lot of thought put into it. I don't take these kinds of things lightly. I've mentioned the rather bad property we have today, where And the longer things have gone on, I've come to think that Trying to find a word for strict equality is difficult, also. FIND/CASE is rather confusing because it doesn't just apply to case (1 is lax equal to 1.0). Also there is a very common CASE construct in the language with a totally different meaning of "case", making it confusing. FIND/STRICT is a lot to type and not that appealing. I propose that FIND/= is briefer and can be connected better with the operation being used. Change is inevitable here, and I think this is one solves a lot of problems with a pleasing result.
IS is a flexible word in English, with many applications. You would say "the total is $29.95", more often than you would say "the car is the car". It could also be used for attributes, like "the car is blue". I realize that the word has a lot of purposes, but I think this one is pretty natural...and my experience with it has shown that the mind can parse expressions that use it better than I'd thought it would. While it doesn't "pop out" the way
~ is very similar when seen from a distance to -. It does not have good properties for readability. It's also in a very inconvenient location on the keyboard (at least mine) and has to be shifted too. When you look at what FIND, SWITCH, and other Rebol operations that use lax comparisons have in common...they are all English words. IS being a word puts it into that category, and it's very natural to read. Rebol is fundamentally a language which is about words over symbols, and using our language processing where possible... |
The step of substituting
Yes, it's called r2warn.reb: The goal was to separate out the warnings so they could be used with the redbol.reb emulation or not. So you could be running under old Rebol conventions and be given a "hey, this changed" message but have it still work the old way... or run under new conventions and be warned as you go about the change. It needs to keep a table and warn only once, etc. I am hoping someone else will develop the feature, I'm just trying to keep the list (!) |
02a98bd
to
fca653a
Compare
The ultimate goal of this commit is to eliminate the STRICT-EQUAL? family of functions and operators, by not having a form of equality that is "more equal than equal". Instead, the lax form of equality in default use by FIND, SWITCH and other operators would be called "is-ness". So "A" is not equal to "a", but `"A" IS "a"`. This adds IS and ISN'T, while temporarily making the former lax equal operations undefined. However, the strict operators are still defined. This gives people a chance to find all the `=` in their code and decide if it should become a `==` or an IS (for example). One difference between IS and ISN'T and previous lax equality is that it does not consider different string types to match, nor does it consider different word types to match. Hence `<FOO> is <fOo>` but `<FOO> isn't "FOO"`. Integers and decimals continue to match within a certain epsilon when using IS. The next step in this process would be taken when all files have been adapted for this change. It would proceed to undefine the strict equality operators, and have them retake `=`, `!=`, and `<>`.
4545fe3
to
f3a5207
Compare
8b3f2a1
to
3aadea5
Compare
378b695
to
daf9392
Compare
7502cb2
to
5924008
Compare
992583b
to
76af4f5
Compare
2c72689
to
df76b52
Compare
f67e366
to
3e965b4
Compare
The ultimate goal of this commit is to eliminate the STRICT-EQUAL?
family of functions and operators, by not having a form of equality
that is "more equal than equal". Instead, the lax form of equality
in default use by FIND, SWITCH and other operators would be called
"is-ness". So "A" is not equal to "a", but
"A" IS "a"
.This adds IS and ISN'T, while temporarily making the former lax equal
operations undefined. However, the strict operators are still defined.
This gives people a chance to find all the
=
in their code and decideif it should become a
==
or an IS (for example).One difference between IS and ISN'T and previous lax equality is that
it does not consider different string types to match, nor does it
consider different word types to match. Hence
<FOO> is <fOo>
but<FOO> isn't "FOO"
. Integers and decimals continue to match withina certain epsilon when using IS.
The next step in this process would be taken when all files have been
adapted for this change. It would proceed to undefine the strict
equality operators, and have them retake
=
,!=
, and<>
.