Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU From: MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU Newsgroups: comp.lang.c Subject: Undelivered mail Message-ID: <12334@brl-adm.ARPA> Date: 13 Mar 88 02:03:40 GMT Sender: news@brl-adm.ARPA Lines: 37 Subject: Re: The D Programming Language [Non-Deliverable: User does not exist or has never logged on] Reply-To: Info-C@BRL.ARPA Received: From UWAVM(MAILER) by ALASKA with Jnet id 9296 for SXJVK@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@BRL.ARPA Sender: Info-C List From: Scott Daniels Subject: Re: The D Programming Language Comments: To: info-c@BRL-SMOKE.arpa To: Vic Kapella In article <587@bms-at.UUCP> stuart@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@teklds.TEK.COM)