From: porton@ex-code.com (Victor Porton)
Subject: Re: Two class-wide operands, but only one controlling
Date: Sun, 24 Nov 2002 16:34:25 +0500
Date: 2002-11-24T11:36:30+00:00 [thread overview]
Message-ID: <3de0b9be$0$304$bed64819@news.gradwell.net> (raw)
In-Reply-To: 3ddfa8b8$0$304$bed64819@news.gradwell.net
In article <877kf34a3t.fsf@inf.enst.fr>,
Samuel Tardieu <sam@rfc1149.net> writes:
>>>>>> "Victor" == Victor Porton <porton@ex-code.com> writes:
>
> Victor> In article <ubs4gvzea.fsf@wanadoo.fr>,
> Victor> Pascal Obry <p.obry@wanadoo.fr> writes:
>>> porton@ex-code.com (Victor Porton) writes:
>>>
>>>> I want something like a procedure with two class-wide operands,
>>>> (of two different types) but only one of these controlling.
>>>>
>>>> The solution I found is introducing new tagged record types which
>>>> would refer to these two types and passing both operands as one
>>>> operand in such the record. Other solutions?
>>>
>>> Declare the second one as a class-wide ('Class) parameter.
>
> Victor> What?! It is clearly stated that I want _both_ of them class
> Victor> wide...
>
> I think you are confusing actual (in the call) and formal (in the
> declaration) parameters. Pascal proposes that you use a first
> non-class-wide formal parameter and a second class-wide formal
> parameter.
Not what I need. basically I have a container and an iterator.
Both a derived (in my case I need this) from abstract container
and abstract iterator. I need procedure like:
procedure Next
(C: Abstract_Container'Class; I: in out Abstract_Iterator'Class);
but this is an error as we have two controlling operands of
different types :-( I cannot make one of these non class-wide
as both a abstract.
It was simple in C++. Ada has disadvantages...
> The actual parameter of a class-wide formal parameter cannot be a
> controlling operand.
Samuel, di you meant vice versa?
next prev parent reply other threads:[~2002-11-24 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-23 16:10 Two class-wide operands, but only one controlling Victor Porton
2002-11-23 19:50 ` Pascal Obry
2002-11-24 8:27 ` Victor Porton
2002-11-24 8:59 ` Samuel Tardieu
2002-11-24 11:34 ` Victor Porton [this message]
2002-11-24 21:56 ` Pascal Obry
2002-11-25 22:17 ` Matthew Heaney
2002-11-27 17:25 ` Matthew Heaney
2002-11-25 19:19 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox