comp.lang.ada
 help / color / mirror / Atom feed
From: "Bernd Ragutt" <BerndRagutt@csi.com>
Subject: exceptions and streams
Date: 1998/10/30
Date: 1998-10-30T00:00:00+00:00	[thread overview]
Message-ID: <O8CzNTFB#GA.364@nih2naaa.prod2.compuserve.com> (raw)

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

Hello,

I tried to write (and read) exception occurrences to a stream;
with the Gnat-Compiler I succeeded,
with the Apex-Compiler I failed.

I think there is a contradiction between RM 11.4.1 (16) and RM 13.13.2 (36).

Any comments?

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


--*******************************************************************

Ada95-Code
Exceptions.Exception_Occurrence'Write
 (Stream => As_Excecption_Stream, Item => An_Exception_Occurrence);

GNAT 3.10 / NT
... compiles and executes the code without an error message.

Rational APEX 3.0 AIX
>>> Line 37: Exceptions.Exception_Occurrence'Write (As_Excecption_Stream,
An_Excecption_Occur);
*** Exceptions.Exception_Occurrence'Write must be specified via an attribute
definition

RM 11.4.1 (16)
The implementation of the Write attribute (see 13.13.2) of
Exception_Occurrence shall [!!!] support writing a representation of an
exception occurrence to a stream; the implementation of the Read attribute
of Exception_Occurrence shall support reconstructing an exception occurrence
from a stream (including one written in a different partition).

RM 13.13.2 (2)
For every subtype S of a specific type T, the following attributes [S�Write,
S�Read] are defined.

RM 13.13.2 (36)
The stream-oriented attributes may be specified for any type via an
attribute_definition_clause. All nonlimited types have default
implementations for these operations. An attribute_reference for one of
these attributes is illegal if the type is limited, unless the attribute has
been specified by an attribute_definition_clause. For an
attribute_definition_clause specifying one of these attributes, the subtype
of the Item parameter shall be the base subtype if scalar, and the first
subtype otherwise. The same rule applies to the result of the Input
function.

AI95-00047/03, 96-02-06
...
The wording of 13.13.2(2) is misleading.  Limited types don't have a
default implementation for the Read and Write attributes, per 13.13.2(36).
Clearly 13.13.2(2) should be reworded to make it clear that although
the attributes are in some sense "defined," it is illegal to evaluate
them for limited types unless the user specifies them.
...
--*******************************************************************






             reply	other threads:[~1998-10-30  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-30  0:00 Bernd Ragutt [this message]
1998-10-31  0:00 ` exceptions and streams dewarr
1998-11-02  0:00   ` Bernd Ragutt
1998-11-03  0:00     ` dewar
1998-11-03  0:00       ` Tucker Taft
  -- strict thread matches above, loose matches on Subject: below --
2006-05-20 16:03 Exceptions and Streams REH
2006-05-21 20:40 ` Simon Wright
2006-05-22 15:11   ` REH
replies disabled

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