From: Ted Dennison <dennison@telepath.com>
Subject: Re: Q: Access subprogram with class type parameters
Date: 2000/03/09
Date: 2000-03-09T00:00:00+00:00 [thread overview]
Message-ID: <8a8un8$an$1@nnrp1.deja.com> (raw)
In-Reply-To: 38C6F379.173A92AF@jhuapl.edu
In article <38C6F379.173A92AF@jhuapl.edu>,
Rush Kester <Rush.Kester@jhuapl.edu> 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.
prev parent reply other threads:[~2000-03-09 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-08 0:00 Q: Access subprogram with class type parameters Rush Kester
2000-03-09 0:00 ` Ted Dennison [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox