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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2fc95e32fd071218 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-24 03:36:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!newsfeed.vmunix.org!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Sun, 24 Nov 2002 16:34:25 +0500 References: <3ddfa8b8$0$304$bed64819@news.gradwell.net> Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Two class-wide operands, but only one controlling Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3de0b9be$0$304$bed64819@news.gradwell.net> NNTP-Posting-Date: 24 Nov 2002 11:36:30 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1038137790 news.gradwell.net 304 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:31193 Date: 2002-11-24T11:36:30+00:00 List-Id: In article <877kf34a3t.fsf@inf.enst.fr>, Samuel Tardieu writes: >>>>>> "Victor" == Victor Porton writes: > > Victor> In article , > Victor> Pascal Obry 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?