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,6abc2e20b7809de7 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Q: Access subprogram with class type parameters Date: 2000/03/09 Message-ID: <8a8un8$an$1@nnrp1.deja.com>#1/1 X-Deja-AN: 595278139 References: <38C6F379.173A92AF@jhuapl.edu> X-Http-Proxy: 1.0 x32.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Mar 09 19:40:25 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-03-09T00:00:00+00:00 List-Id: In article <38C6F379.173A92AF@jhuapl.edu>, Rush Kester wrote: > This is my first attempt at using subprogram access types and class > programming. > > Why doesn't Default_Get_Procedure match Get_Procedure in the following? > > type Get_Procedure is access procedure ( > File : in text_io.file_type; > Value : out values'class); > > procedure Default_Get_Procedure( > File : in text_io.file_type; > Value : out Bool_Values) is Because Values'Class and Bool_Values aren't the same type. You can't define a procedure type that will take a procedure with a parameter of a different type than is in the declaration, even if that different type does happen to have been derived from the one specified. I made this exact mistake about 3 months ago when I was trying to write the parsing support for OpenToken. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.