strings

Prescott K. Turner turner at sdti.SDTI.COM
Sat May 13 00:53:00 AEST 1989


In article <1989May11.155935.22324 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>In article <10235 at socslgw.csl.sony.JUNET> diamond at 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 at sdti.sdti.com



More information about the Comp.lang.c mailing list