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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 02 Jun 2009 11:36:43 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Howto read line from a stream References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <1a90e055-44a3-4d00-b4cd-64798c731a55@e24g2000vbe.googlegroups.com> <16949835-6528-4a7a-a653-fd466b37bb45@s21g2000vbb.googlegroups.com> <18nn8atp3gdq1$.6g5cqv5h6u1c.dlg@40tude.net> <1dlvlys7r0tyh$.zyytlf2vt5zm.dlg@40tude.net> In-Reply-To: <1dlvlys7r0tyh$.zyytlf2vt5zm.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4a24f2ab$0$31340$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 02 Jun 2009 11:36:44 CEST NNTP-Posting-Host: b74a62ab.newsspool4.arcor-online.net X-Trace: DXC=I1E:EUPBgm<^cW`WBF>WQ<4IUK Dmitry A. Kazakov schrieb: > P.P.S. There are lots of text-oriented protocols used in automotive. The > device vendors just do not care to handle LFs and CRs as specified (if > specified! (:-)). You buy a $10**5+ device and have to communicate with it. > Guess which side has to be fixed? The trouble is that '\n' in C source does not necessarily mean '\n' in the data, same for New_Line. How early in a programmer's life does she learn to assume that '\n' means '\n', 'A' means 65 and CHAR_BIT is 8 ? The earlier this damage is done, the more difficult it is to mend. I understand they still use ASCII tables at universities when they explain character data. They do not explain the concept of a data type with possible representations of values, as should be. Let alone representations of ends of lines. This bit of teaching, eternalized as a tradition, undermines the fundamental (and early) understanding of types. So having protocols depend on an understanding of line termination is at odds with common knowledge; when common knowledge is used to implement protocols, some effects become predictable consequences.