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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,bed01d177eaef486 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.82.226 with SMTP id l2mr1313093wiy.1.1343315034247; Thu, 26 Jul 2012 08:03:54 -0700 (PDT) Path: q11ni75951007wiw.1!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news.antakira.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Signature Package With Generic Proceedure Date: Sun, 22 Jul 2012 09:28:53 +0200 Organization: cbb software GmbH Message-ID: <6mwstm0x0r65$.z95f6vddgx77.dlg@40tude.net> References: <045f7b44-2a4a-4292-80fd-0b6bc8ee3465@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 9A8bJrx4NhDLcSmbrb6AdA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-07-22T09:28:53+02:00 List-Id: On Sat, 21 Jul 2012 15:22:36 -0700 (PDT), Adam Beneschan wrote: > On Saturday, July 21, 2012 10:22:25 AM UTC-7, Keean Schupke wrote: >> If I have a package which defines a procedure like: >> >> generic >> with procedure Process(Set : in out Set_Type); >> procedure Update(Set : in out Set_Type); >> >> How do a declare a Signature package that includes this? >> >> generic >> with generic >> with procedure Process(Set : in out Set_Type); >> procedure Update(Set : in out Set_Type); >> package Set_Signature is end; >> >> Is not allowed. Is there some way to do this with nested packages? > > There's no such thing as "with generic" in Ada. That is, there is no way > to set things up so that you can instantiate a generic like this: > > package An_Instantiation is new A_Generic (G1); > > where G1 is the name of a *generic* subprogram or package. Nor can I > think of a reason why you'd want to. Perhaps if you gave us an example of > what you're trying to accomplish? Probably it is passing an instance of a specific generic procedure to a generic package? Note, rather than passing any procedure with matching signature, e.g. generic with procedure Foo (...); package Boo ... , only such Foo, which is an instance of a generic procedure Baz. Imaginary syntax borrowed from packages: generic with procedure Foo is new Baz (<>); -- This is not Ada! package Boo ... This is impossible. An obvious solution is to place Baz into a generic package and pass an instance of that package instead. (Ada's generics lack many formal types, e.g. this one) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de