comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada.Storage_IO: applied example?
Date: Wed, 24 Oct 2012 12:28:00 +0200
Date: 2012-10-24T12:28:00+02:00	[thread overview]
Message-ID: <1idlxs32flh5u.fi8rvodiy7c2.dlg@40tude.net> (raw)
In-Reply-To: ca5e1dba-d5d4-4f7c-b0c0-2270f683b86a@googlegroups.com

On Wed, 24 Oct 2012 02:49:02 -0700 (PDT), AdaMagica wrote:

> See AARM A.9(1.a):
> Reason: This package exists to allow the portable construction of
> user-defined direct-access-oriented input-output packages.

   portable construction of X /= construction of portable X

The package cannot be used to write files in a way that an application
compiled by one compiler X1 under OS Y1 could write a file readable for
compiler X2 under OS Y2.

In order to be portable they should have defined the exact representation
of the object in the file. Yes, nobody would do that, but then they should
not include useless packages into the standard either.

> On Wednesday, October 24, 2012 9:34:32 AM UTC+2, Dmitry A. Kazakov wrote:
>> data at. Furthermore the generic parameter should have been declared as:
>>    type Element_Type (<>) is private.
> 
> See A.9(10.a):
> Reason: As with Direct_IO, the Element_Type formal of Storage_IO does not
> have an unknown_discriminant_part so that there is a well-defined upper
> bound on the size of the buffer needed to hold the content of an object of
> the formal subtype (i.e. Buffer_Size).

The reason why Direct_IO must have an upper bound is to allow accessing
records randomly without an excessive (in 70's it was excessive) overhead
of indexing them. This simply does not apply to Storage_IO, which has just
one "record."

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-10-29  2:38 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
2012-10-24  9:49       ` AdaMagica
2012-10-24 10:28         ` Dmitry A. Kazakov [this message]
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