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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,865c3d125a8dbc3b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!n8g2000vbb.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Howto read line from a stream Date: Sun, 31 May 2009 15:00:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <03bab021-0df6-445b-b2f7-7a3ab770448c@b1g2000vbc.googlegroups.com> NNTP-Posting-Host: 82.20.239.89 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1243807225 26559 127.0.0.1 (31 May 2009 22:00:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 31 May 2009 22:00:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n8g2000vbb.googlegroups.com; posting-host=82.20.239.89; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 Safari/525.28.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6144 Date: 2009-05-31T15:00:24-07:00 List-Id: On May 31, 5:07=A0pm, "Dmitry A. Kazakov" wrote: > On Sun, 31 May 2009 08:38:57 -0700 (PDT), sjw wrote: > > On May 31, 12:34=A0pm, "Dmitry A. Kazakov" > > wrote: > > >> One potential problem with using Streams as an interface to sockets is= that > >> there is nothing in the Ada standard that mandates Stream_Element to b= e an > >> octet of bits, as socket I/O demands. > > > Can't imagine what reason an implementer would have to make a stream > > element anything other than an octet! (for any general-purpose > > processor you'd actually be likely to come across). > > This is a question you should better address to the designers of the Ada > standard. For some reasons they didn't take the responsibility to mandate > that Stream_Element'Size =3D 8. Fairly strong hint, I think, in http://www.adaic.com/standards/05aarm/html/= AA-13-13.html (1). An implementation with Stream_Element'Size /=3D 8 would be in a world of its own, probably better off not to bother with a socket library! > I am not a language lawyer, but I remember a DSP processor with > sizeof(char)=3D4. I spent a lot of time with a processor that (if it had had a C compiler) would have had 24-bit chars. > I suggest that it should be difficult quite there to have: > > =A0 =A0type Stream_Element_Array is > =A0 =A0 =A0 =A0 array(Stream_Element_Offset range <>) of aliased Stream_E= lement; > > (note *aliased*), with 8 bit Stream_Element and packed > Stream_Element_Array. See http://www.adaic.com/standards/05aarm/html/AA-13-13-1.html (11.c/2)