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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d7c81785cd4fb3cb X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: I want 'Class'Input back! Date: 1999/10/13 Message-ID: <7u2377$mvf$1@nnrp1.deja.com>#1/1 X-Deja-AN: 536225249 References: <7u0as6$fmm$1@nnrp1.deja.com> <3803cc6c_1@news1.prserv.net> X-Http-Proxy: 1.0 x41.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Oct 13 13:59:12 1999 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 1999-10-13T00:00:00+00:00 List-Id: In article <3803cc6c_1@news1.prserv.net>, "Matthew Heaney" wrote: > In article <7u0as6$fmm$1@nnrp1.deja.com> , Ted Dennison > wrote: > > attributes. In fact, I need 'Input, 'Output, 'Class'Input, and > > 'Class'Output. Yikes! What was I thinking? I meant 'Read and 'Write. 'Input is clearly nonsense on a limited type (as using it would require assignment). > I think you only need to replace the stream attribute operations of > the *specific* type T. > > The stream attributes T'Class'Input and T'Class'Output describe the > attributes of the *class-wide* type, which the compiler supplies for > you. That's what I thought too after a cursory look at the literature. However, according to both Gnat and my TFFE-based compiler, that is not the case. Without a redefinition of "Instance'Class'Read", both compilers yack at me with essentially the same error message. Here's the Gnat example; a line reading: Instance'Class'Read (Ada.Streams.Stream_Io.Stream(File), Table); Gets flagged with the following error message: interpolation_table.adb:92:18: limited type "Instance'Class" has no stream attributes Even though I *do* have the following: procedure Read (Stream : access Ada.Streams.Root_Stream_Type'Class; Item : out Instance); type Instance is abstract tagged limited record ... for Instance'Read use Read; If I also add the following lines, the error goes away (with both compilers): procedure Read (Stream : access Ada.Streams.Root_Stream_Type'Class; Item : out Instance'Class); ... for Instance'Class'Read use Read; But the problem (as I mis-said before), is that I can't figure out how I could possibly code my classwide "Read" function to do what 'Class'Read does. -- T.E.D. Sent via Deja.com http://www.deja.com/ Before you buy.