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,eda0a7cd6069ee4 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Type mess in Ada standard library Date: 1999/07/23 Message-ID: <3798F02F.F56EA7C5@averstar.com>#1/1 X-Deja-AN: 504568374 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <7n1uu4$so8$1@pegasus.csx.cam.ac.uk> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-07-23T00:00:00+00:00 List-Id: Markus Kuhn wrote: > > Why do the packages > > Ada.Streams.Stream_IO > > and > > Ada.Text_IO.Text_Streams > > both have to define their own identical but incompatible > > type Stream_Access is access all Streams.Root_Stream_Type'Class; > > ??? > > This looks like a complete mess to me. If I use both packages (and > it is certainly not unreasonable to do so!), I have two different types > for exactly the same purpose. ... Well, to answer this question narrowly: These Stream_Access types are *only* used as the result type of the "Stream" function, which is designed for passing directly into another subprogram like T'Input, T'Output, etc. So at least in this particular case, there is almost no need to define any variables of the type Stream_Access (and in fact, it is probably unwise, since the lifetime of the access values produced is tied to the lifetime of the File type). I appreciate your larger concern, but I think in this case the use of a local Stream_Access type is appropriate. Perhaps a "NOTE" to indicate the intended use of values of Stream_Access type might have alleviated your concern. > Markus > > -- > Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK > Email: mkuhn at acm.org, WWW: -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA