Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!apollo!mrst!sdti!turner From: turner@sdti.SDTI.COM (Prescott K. Turner) Newsgroups: comp.lang.c Subject: Re: strings Summary: second class Message-ID: <456@sdti.SDTI.COM> Date: 12 May 89 14:53:00 GMT References: <2846@tank.uchicago.edu> <5785@cbnews.ATT.COM> <10087@smoke.BRL.MIL> <1415@uw-entropy.ms.washington.edu> <17333@mimsy.UUCP> <10228@socslgw.csl.sony.JUNET> <10237@smoke.BRL.MIL> <10235@socslgw.csl.sony.JUNET> <1989May11.155935.22324@utzoo.uucp> Reply-To: turner@sdti.UUCP (0006-Prescott K. Turner, Jr.) Organization: Software Development Technologies, Sudbury MA Lines: 22 In article <1989May11.155935.22324@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <10235@socslgw.csl.sony.JUNET> diamond@csl.sony.junet (Norman Diamond) writes: >>Strings, for example. >> ... >>C says that a string is terminated with a '\0' byte. >> ... so the implementation of C library routines can never be speeded up. >>For other languages, improvements are often made to implementations. > >Improvements to C library routines are quite possible. Like all such, >cleverness is sometimes required. One convention is not intrinsically >worse than the other. Diamond is right. C is worse because it specifies not just the operations on string types and their meaning, but the representation of strings. As Paul Abrahams put it in SIGPLAN Notices 23:10, "Some Sad Remarks About String Handling in C", "C strings are not first class objects." He gives details of how this prevents the clever from succeeding. -- Prescott K. Turner, Jr. Software Development Technologies, Inc. P.O. Box 366, Sudbury, MA 01776 USA (508) 443-5779 UUCP: ...{harvard,mit-eddie}!sdti!turner Internet: turner@sdti.sdti.com