From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada.Storage_IO: applied example?
Date: Wed, 24 Oct 2012 09:34:58 +0200
Date: 2012-10-24T09:34:58+02:00 [thread overview]
Message-ID: <ojrfstwtiak6.oeklfsnvcr1k$.dlg@40tude.net> (raw)
In-Reply-To: k67srd$5tl$1@dont-email.me
On Wed, 24 Oct 2012 07:03:43 +0200, J-P. Rosen wrote:
> Le 23/10/2012 22:28, Dmitry A. Kazakov a �crit :
>> On Tue, 23 Oct 2012 21:42:43 +0200, Yannick Duch�ne (Hibou57) wrote:
>>
>>> I'm seeking for a tiny use case showing `Ada.Storage_IO` in action.
>>
>> It looks useless at first glance. The buffer size is fixed and
>> implementation defined(!). Why would anybody use that rather than plain
>> array?
>>
> Imagine you want to implement a binary IO package. On one side you have
> high level data type, on the other side system files that are just
> blocks of bytes. Storage_IO allows you to bridge this gap (at least
> that's my understanding).
In that case the package should rather define conversions to and from
Storage_Array, better as in-place operations with a position to get/put
data at. Furthermore the generic parameter should have been declared as:
type Element_Type (<>) is private.
And, of course, implementation-defined I/O is a bad idea anyway in modern
times of interoperability. (This also applies to Direct_IO and
Sequential_IO, which are remnants of late 70's.)
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2012-10-28 2:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 19:42 Ada.Storage_IO: applied example? Yannick Duchêne (Hibou57)
2012-10-23 20:28 ` Dmitry A. Kazakov
2012-10-23 20:56 ` Yannick Duchêne (Hibou57)
2012-10-23 21:21 ` Adam Beneschan
2012-10-23 21:02 ` Jeffrey Carter
2012-10-24 7:20 ` Dmitry A. Kazakov
2012-10-24 5:03 ` J-P. Rosen
2012-10-24 7:34 ` Dmitry A. Kazakov [this message]
2012-10-24 9:49 ` AdaMagica
2012-10-24 10:28 ` Dmitry A. Kazakov
2012-10-24 11:51 ` Yannick Duchêne (Hibou57)
2012-10-24 12:27 ` Dmitry A. Kazakov
2012-10-24 14:03 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox