Re: Sequence comparison

new topic     » goto parent     » 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

Yes i am aware of this option, but that is still using functions, i am just
wondering if Rob ever wanted to implement an operator for sequence
comparison.

like this:

  sequence s1,s2
  s1 = "ian"
  s2 = "ian"

  if s1 $= s2 then
    printf(1,"s1 = s2\n",{s1,s2})
  else
    printf(1,"s1 != s2\n", {s1,s2})
  end if

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu