Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!agate!shelby!decwrl!decvax!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: strings Message-ID: <13233@haddock.ima.isc.com> Date: 20 May 89 22:17:24 GMT References: <31787@sri-unix.SRI.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 18 In article <31787@sri-unix.SRI.COM> diamond@diamond.csl.sony.junet (Norman Diamond) writes: >[in two separate articles, Doug Gwyn writes:] >>If you want counted strings, C makes it relatively easy to provide them for >>yourself... Furthermore there is no reason your counted-string >>implementation should be other than perfectly portable. > >Yes, just like [you can use Silly Macros to make C look like Algol] >and still be perfectly portable. Everyone will hate you. Not analogous. Yes, I would curse your grave if you used the SHELLGOL macros in a program I had to maintain, but no, I would not object to the use of a struct {size_t; char *} to represent text in cases where the usual model is inappropriate. (Note that last phrase: "in cases where the usual model is inappropriate". For most purposes, \0-termination works just fine.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint