Re: Pascal vs C style string ?

Stefan Monnier <monnier@di.epfl.ch>
Tue, 28 Jun 1994 14:22:07 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: Pascal vs C style string ? prener@watson.ibm.com (1994-06-27)
Re: Pascal vs C style string ? jhallen@world.std.com (1994-06-27)
Re: Pascal vs C style string ? ddean@robadome.com (1994-06-27)
Re: Pascal vs C style string ? boehm@parc.xerox.com (1994-06-27)
Re: Pascal vs C style string ? nandu@cs.clemson.edu (1994-06-27)
Re: Pascal vs C style string ? eifrig@beanworld.cs.jhu.edu (1994-06-28)
Re: Pascal vs C style string ? monnier@di.epfl.ch (Stefan Monnier) (1994-06-28)
Re: Pascal vs C style string ? eru@tele.nokia.fi (Erkki Ruohtula) (1994-06-28)
Re: Pascal vs C style string ? andrew@cee.hw.ac.uk (1994-06-28)
Re: Pascal vs C style string ? jhallen@world.std.com (1994-06-28)
Re: Pascal vs C style string ? larryr@pa.dec.com) (1994-06-28)
Re: Pascal vs C style string ? boehm@parc.xerox.com (1994-06-28)
Re: Pascal vs C style string ? cjmchale@dsg.cs.tcd.ie (1994-06-29)
[6 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: Stefan Monnier <monnier@di.epfl.ch>
Keywords: C, Pascal, design
Organization: Ecole Polytechnique Federale de Lausanne
References: 94-06-214
Date: Tue, 28 Jun 1994 14:22:07 GMT

<nandu@cs.clemson.edu> wrote:
> One hack around that could be to encode the zero byte as
> zero-zero bytes. The decoding routine identifies consecutive
> zero-zero bytes as the encoding of a single legal zero byte and
> understands that a singly occuring zero byte is actually the end of
> string marker. I believe this hack is used in transmitting packets




How convenient. That reminds me of the ugly hacks due to ms-dos's
encoding of end-of-line as 'CR-LF'. The encoding makes sense, but the
fact that it's a two-caracter symbol is a pain: length related
operations become really annoying (especially for seeks) etc...
If it's totally hidden, fine. But if such things appear anywhere else
than in a library, it's a hack.


Stefan
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.