From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,549562583b1942d9 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: exceptions and streams Date: 1998/11/03 Message-ID: #1/1 X-Deja-AN: 407866354 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <71m20v$s6o$1@nnrp1.dejanews.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-11-03T00:00:00+00:00 List-Id: dewar@gnat.com wrote: : ... : These paragraphs are not in the slightest bit contradictory. They simply : say that the implementor must define (non-default) implementations of the : stream attributes for the type Exception_Occurrence. : In GNAT this is done using the special GNAT pragma Stream_Convert, which : provides a way of implementing these stream attributes without dragging in : all the stream stuff unconditionally. How does your Stream_Convert pragma work? Without some kind of special pragma, it is a royal pain to define the 'Read and 'Write attributes for a limited private type like Exception_Occurrence. You must define the attributes visibly to make it public that they exist, but you must define them after the limited private type is fully defined because the definition is considered a representation clause. This requires defining multiple Exception_Occurrence-like types, with the visible one in Ada.Exceptions inheriting from some limited private type declared elsewhere which has the 'Read and 'Write defined, using various and sundry shenanigans involving nested packages, multiple derivations, etc. Some kind of pragma which indicated: "This limited type has stream attributes" would simplify things dramatically. And while we are on the topic of the limitness of Exception_Occurrence, the deferred constant Null_Occurrence is also a royal pain. During most of the Ada 9X revision process, Exception_Occurrence was non-limited, and Null_Occurrence was somewhat useful. However, now that Exception_Occurrence is limited, Null_Occurrence is pretty useless, and a pain to implement. I suppose this is pretty old news for us poor implementors... : ... : Robert Dewar : Ada Core Technologies -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company