Undelivered mail

MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU MAILER%ALASKA.BITNET at CUNYVM.CUNY.EDU
Sun Mar 13 12:03:40 AEST 1988


Subject:  Re: The D Programming Language

[Non-Deliverable:  User does not exist or has never logged on]

Reply-To: Info-C at BRL.ARPA

Received: From UWAVM(MAILER) by ALASKA with Jnet id 9296
          for SXJVK at ALASKA; Sat, 12 Mar 88 16:52 AST
Received: by UWAVM (Mailer X1.25) id 6030; Sat, 12 Mar 88 17:52:24 PST
Date:         Sat, 12 Mar 88 01:56:28 GMT
Reply-To:     Info-C at BRL.ARPA
Sender:       Info-C List <INFO-C at NDSUVM1>
From:         Scott Daniels <daniels at teklds.TEK.COM>
Subject:      Re: The D Programming Language
Comments: To: info-c at BRL-SMOKE.arpa
To:           Vic Kapella <SXJVK at ALASKA>

In article <587 at bms-at.UUCP> stuart at bms-at.UUCP (Stuart D. Gathman) writes:
>Another example is string comparison.  I use a string compare function
>that returns the index of the first different character.  I also
>need the gt/lt/eq result.  Fortunately, in this case it is easily
>computed by recomparing the chars at the index.

An alternative is the string comparison I normally use:

    cmpstr(s1,s2)
0: if equal
>0: if s1 > s2
<0: if s1 < s2

abs(cmpstr(s1,s2)) is the number of chars compared:
  s1[ abs(cmpstr(s1,s2))-1 ] != s2[ abs(cmpstr(s1,s2))-1 ]
  if cmpstr did not return 0.  Normally this function returns just
  about any information I need, and it is usually not very hard to
  make an extremely fast version in assembly.

-Scott Daniels (daniels at teklds.TEK.COM)



More information about the Comp.lang.c mailing list