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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.26.203 with SMTP id a194mr16446779ioa.22.1517264802616; Mon, 29 Jan 2018 14:26:42 -0800 (PST) X-Received: by 10.157.71.7 with SMTP id a7mr507472otf.5.1517264802505; Mon, 29 Jan 2018 14:26:42 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!w142no1015193ita.0!news-out.google.com!b73ni4059ita.0!nntp.google.com!g80no1008412itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 29 Jan 2018 14:26:42 -0800 (PST) In-Reply-To: <3da7bd47-c325-4b25-bb6e-6f53773835ef@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a01:e35:2ecd:88c0:2ca7:86cb:394c:f39c; posting-account=O1Kt4QoAAABKYAjrg-cGai_vZLnN2LEw NNTP-Posting-Host: 2a01:e35:2ecd:88c0:2ca7:86cb:394c:f39c References: <61ba3677-0041-4dba-af9b-a5df48f3ce8a@googlegroups.com> <6427a793-91a4-4feb-b067-ed89b4c04421@googlegroups.com> <3af9cfc4-d434-4d60-a4ed-17a16f75717f@googlegroups.com> <3da7bd47-c325-4b25-bb6e-6f53773835ef@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Iterable container as generic parameter From: Lionel Draghi Injection-Date: Mon, 29 Jan 2018 22:26:42 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:50201 Date: 2018-01-29T14:26:42-08:00 List-Id: Le lundi 29 janvier 2018 14:34:07 UTC+1, briot.e...@gmail.com a =C3=A9crit= =C2=A0: > > function Id_Set_Image is new List_Image.Image > > (Cursor =3D> Cursor, > > Image =3D> Element, > > Iterator_If =3D> Set_Iterator_Interfaces, > > Container =3D> Set, > > Iterator =3D> Iterate, > > Style =3D> List_Image.Bracketed_List_Style); > > Any idea to simplify is welcome. >=20 > Seems to me that you need not pass Cursor explicitly here, since you are = already > gettng it from Set_Iterator_Interfaces. Good point indeed. This compile fine : with Ada.Iterator_Interfaces; package List_Image is generic with package Iterator_If is new Ada.Iterator_Interfaces (<>); use Iterator_If; =20 with function Image (C : Cursor) return String is <>; =20 function Image return String; end List_Image; But this : package body List_Image is function Image return String is C1 : Cursor; begin return ""; end Image; end List_Image; cause a : 4:12 invalid use of type before its full declaration 4:7 premature usage of incomplete type "Ada.Iterator_Interfaces.Cur= sor" from instance at list_image.ads:6 Am I missing something?