From: hainque@news.enst.fr (Olivier Hainque)
Subject: Re: Ada 95 dispatching question
Date: 1997/11/27
Date: 1997-11-27T00:00:00+00:00 [thread overview]
Message-ID: <65ke04$2ss$1@enst.enst.fr> (raw)
In-Reply-To: 880581829.29833@dejanews.com
Adam Beneschan (adam@irvine.com) wrote:
: What should the following program output? I'm trying to get it to
: output
: 3/TRUE/"abcdefghij"/ 15
: but it outputs instead
: 3/TRUE/???
The output is correct, ...
: If the output is correct, then why? In particular, is the line marked
: "<=== HERE" a dispatching call, and if not, why not? And how would I
: have to modify the program to get it to do what I'd like it to do,
: given that declaring do_to_aux and do_to_rec in PACK1 is not an
: option?
The call
: do_to_aux (auxinfotype2 (r.f3.all)); -- <=== HERE
is not a dispatching call since the actual argument you give is
not classwide typed.
In fact, you actually tell : "I want to call the do_to_aux procedure
with an argument of type 'auxinfotype2'".
For this call to be dispatching, you have to provide a classwide
argument. I think the following will do :
: do_to_aux (auxinfotype2'Class (r.f3.all));
Hope this helps.
-- Olivier Hainque
--
E-mail: hainque@inf.enst.fr
P-mail: Telecom Paris
46, rue Barrault - 75634 Paris cedex 13
next prev parent reply other threads:[~1997-11-27 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-11-26 0:00 Ada 95 dispatching question Adam Beneschan
1997-11-26 0:00 ` Matthew Heaney
1997-11-27 0:00 ` Olivier Hainque [this message]
1997-11-27 0:00 ` Olivier Hainque
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox