From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6bf9d4ba0cfd8cb6 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Announce: OpenToken 2.0 released Date: 2000/02/17 Message-ID: #1/1 X-Deja-AN: 586933252 Sender: bobduff@world.std.com (Robert A Duff) References: <3890C62B.18309585@telepath.com> <876unj$jcs$1@nnrp1.deja.com> <87d7qck6pm.fsf@deneb.cygnus.argh.org> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-02-17T00:00:00+00:00 List-Id: Hyman Rosen writes: > The C/C++ stream interface concerns itself with reading characters > from input streams. The char type is able to hold any character > read from a stream. This discussion is about how input functions > can provide end-of-file notification. One way is to have an > out-of-band value returned by the single-character reader function. > The C way of doing this is to have the return type of that function > be int. It is then the case that if the implementation has int and > char the same size, and the input format is such that every possible > bit pattern for char may be present, then this out-of-band method > will not work, and one of the available alternate methods must be > used, such as fread or feof. This situation is rare, and may even be > non-existent. > > Do you feel that your comment has contributed anything to this > discussion? To me it seems to be a snide and pointless attack on C. I'm sorry to offend you. My point was simply that the C programming language has a design flaw (namely, confusion between characters and integers) that contributes to the poor design we were talking about (namely, assuming that int can represent every char value, plus at least one more value, which is not always the case). In my opinion, of course. Again, I apologize if my criticism of these particular aspects of C has offended you. - Bob P.S. If it makes you feel better, I have a habit of criticizing certain aspects of every programming language I've ever learned, including the ones I've helped design. ;-) ;-)