Re: RFC: Breaking existing Euphoria functionality

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

Aren't we really just talking about making an operator alias for the compare()
function?  I mean, we CAN compare sequences in "if" statements now, correct? 
This is all about not getting to type what you want to type?  (i.e. I don't want
to type "compare(a,b)", I want to type "a < b" instead.)

So just make some new operators (that work in "if" statements and elsewhere too)
that only do comparisons -- add a colon prefix to them, for instance:

a := b           equivalent to "compare(a,b) = 0"
a :< b           equivalent to "compare(a,b) < 0"
a :> b           equivalent to "compare(a,b) > 0"
a :<= b          equivalent to "compare(a,b) <= 0"
a :>= b          equivalent to "compare(a,b) >= 0"

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

Search



Quick Links

User menu

Not signed in.

Misc Menu