comp.lang.ada
 help / color / mirror / Atom feed
* Stream_io / records with default discriminants
@ 1999-02-14  0:00 Bernd Ragutt
  1999-02-14  0:00 ` Matthew Heaney
  1999-02-14  0:00 ` David C. Hoos, Sr.
  0 siblings, 2 replies; 9+ messages in thread
From: Bernd Ragutt @ 1999-02-14  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1426 bytes --]

Hello!

I am trying to understand writing to and reading from streams.

The Ada95 LRM 13.13.2 (26) states "If T has discriminants without (!)
defaults, S�Output ...".

I have no problems writing and reading records without (!) default
discriminants (using S'Output and S'Input).
But when trying to read a record with (!) a default discriminant (using
S'Output and S'Input), there is an exception.

What's wrong?

I do understand the LRM the following way:
For every subtype S of a specific type T, that is, for all (!) types,  with
and without default discriminants, writing and reading with S'Output and
S'Input should function.

Any comments?

Bernd Ragutt
from Munich
----------------------
BerndRagutt@csi.com


*** ***
Ada95 LRM 13.13.2 Stream-Oriented Attributes
...
25 Unless overridden by an attribute_definition_clause, ... [S'Input,
S'Output] ... execute as follows:
26 � If T is an array type, S�Output first writes the bounds, and S�Input
first reads the bounds.
If T has discriminants without defaults, S�Output first writes the
discriminants (using S�Write for each),
and S�Input first reads the discriminants (using S�Read for each).
27 � S�Output then calls S�Write to write the value of Item to the stream.
S�Input then creates an object (with the bounds or discriminants, if any,
taken from the stream),
initializes it with S�Read, and returns the value of the object.
*** ***






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-02-18  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-14  0:00 Stream_io / records with default discriminants Bernd Ragutt
1999-02-14  0:00 ` Matthew Heaney
1999-02-14  0:00   ` Bernd Ragutt
1999-02-14  0:00     ` robert_dewar
1999-02-14  0:00     ` Nick Roberts
1999-02-15  0:00       ` robert_dewar
1999-02-17  0:00         ` Nick Roberts
1999-02-18  0:00           ` dennison
1999-02-14  0:00 ` David C. Hoos, Sr.

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