Re: Why not == ?

new topic     » goto parent     » topic index » view thread      » older message » newer message
Bhupen1277 said...
achury said...

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu