comp.lang.ada
 help / color / mirror / Atom feed
From: sjw <simon.j.wright@mac.com>
Subject: Re: Howto read line from a stream
Date: Sun, 31 May 2009 15:00:24 -0700 (PDT)
Date: 2009-05-31T15:00:24-07:00	[thread overview]
Message-ID: <d347a6eb-02e9-4f02-b1bb-75899a030138@n8g2000vbb.googlegroups.com> (raw)
In-Reply-To: e70d9rk33jqr$.1c2o1spckc5nw.dlg@40tude.net

On May 31, 5:07 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> On Sun, 31 May 2009 08:38:57 -0700 (PDT), sjw wrote:
> > On May 31, 12:34 pm, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> > 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 be 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 = 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 /= 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)=4.

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:
>
>    type Stream_Element_Array is
>         array(Stream_Element_Offset range <>) of aliased Stream_Element;
>
> (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)



  parent reply	other threads:[~2009-05-31 22:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31 10:41 Howto read line from a stream Tomek Walkuski
2009-05-31 11:29 ` Tomek Wałkuski
2009-05-31 12:02   ` Dmitry A. Kazakov
2009-05-31 12:56     ` Tomek Wałkuski
2009-05-31 14:30       ` Tomek Wałkuski
2009-05-31 15:13       ` Dmitry A. Kazakov
2009-06-01 23:30         ` Randy Brukardt
2009-06-02  7:30           ` Dmitry A. Kazakov
2009-06-02  9:36             ` Georg Bauhaus
2009-06-02 10:24               ` Dmitry A. Kazakov
2009-06-02 21:15             ` Randy Brukardt
2009-06-01  6:34     ` Pascal Obry
2009-06-01  0:05   ` Jeffrey R. Carter
2009-06-03 15:49     ` Tomek Wałkuski
2009-06-03 18:04       ` Jeffrey R. Carter
2009-06-03 21:41         ` Maciej Sobczak
2009-06-04  8:56           ` Jean-Pierre Rosen
2009-06-04  9:05             ` Ludovic Brenta
2009-06-04 13:05             ` Maciej Sobczak
2009-06-04 14:16               ` Jean-Pierre Rosen
2009-06-04 19:48                 ` Ludovic Brenta
2009-06-04 14:24               ` Dmitry A. Kazakov
2009-06-03 19:07       ` sjw
2009-06-03 19:26         ` Dmitry A. Kazakov
2009-06-03 19:43           ` Georg Bauhaus
2009-06-03 20:11             ` Dmitry A. Kazakov
2009-06-03 22:09               ` Georg Bauhaus
2009-06-04  8:19                 ` Dmitry A. Kazakov
2009-06-04  9:41                   ` Georg Bauhaus
2009-06-04 10:23                     ` Dmitry A. Kazakov
2009-06-04 12:14                       ` Georg Bauhaus
2009-06-04 14:54                         ` Dmitry A. Kazakov
2009-06-04 16:33                           ` Georg Bauhaus
2009-06-05  9:57                             ` Dmitry A. Kazakov
2009-06-04 14:16         ` andrew
2009-06-01 19:12   ` björn lundin
2009-05-31 11:34 ` Dmitry A. Kazakov
2009-05-31 15:38   ` sjw
2009-05-31 16:07     ` Dmitry A. Kazakov
2009-05-31 20:39       ` Niklas Holsti
2009-05-31 22:00       ` sjw [this message]
2009-06-01  8:35         ` Dmitry A. Kazakov
2009-06-01 23:34     ` Randy Brukardt
2009-06-02  2:27 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox