Sequence comparison
- Posted by Michael Nelson <mike-nelson-ODAAT at WORLDNET.ATT.NET> Apr 25, 2000
- 404 views
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