Rebol and Red have a notion of the ordinary equal?
function (offered infix simply as =
) as being a sort of "natural equality". Hence it is willing to compare 1 = 1.0
even though one is an integer and the other a float... and to compare strings and characters case-insensitively by default.
The strict-equal?
function is case-sensitive, demands things be the same datatype, and is tied to ==
as infix. (There is also a strict-not-equal?
function as !==
.)
However, the other comparison operators don't seem to have a strict variant. How would one implement a strict-greater?
or a strict-lesser-or-equal?
, etc. with the primitives in the box?
Behavior would be, for instance:
>> strict-lesser? "A" "a"
== true