Sequence comparison

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

I almost never use compare() directly.  I use equal(0 and the following very
simple comparisons of my own (might run a bit faster if incorporated into
EU):

global function less(object a,object b)
    return compare(a,b) = -1
end function

global function greater(object a,object b)
    return compare(a,b) = 1
end function

global function between(object a,object b,object c)
    return compare(a,b) > -1 and compare(a,c) < 1
end function

greater-than-or-equal-to can be expressed as not less(), etc.

-- Mike Nelson

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

Search



Quick Links

User menu

Not signed in.

Misc Menu