Re: Why not == ?
- Posted by Spock Nov 06, 2022
- 599 views
Sometimes I get tired of using equal() to compare sequences.
Why not == or === as phyton does?
Euphoria's roots are from APL. Today we have the "â†" and " →" symbols available easily.
It would be prudent to use these for assignment and storage and use "=" for equal()
In the programming system I use [Orac - basically a super pre-processor for Euphoria incorporating an intelligent editor, incremental compilation etc] all comparisons - regardless of type - can use the standard operators but the final output is compiled to the verbose functions, eg:
if a = b then -- this becomes if equal(a,b) then if a < b then -- this becomes [I believe] if compare(a,b) = -1 then etc
When the compiler can detect an atomic comparison the native operator is left intact.
I can't imagine ever using clunky verbose functions for normal comparisons. And I never had a problem with assignments using the same operator, eg:
a = b=c -- a must be either 1 or 0
Spock