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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d7b3e24220f64b53,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: "Rick Santa-Cruz" Newsgroups: comp.lang.ada Subject: generic with procedure Date: Tue, 28 Sep 2004 23:52:13 +0200 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1096408350 03 22138 OXJkXwkL+ViROlR 040928 21:52:30 X-Complaints-To: usenet-abuse@t-online.de X-ID: r4gj-TZYgebKvINBkMOKBcQl4oEVHORZLAMpBJjSearZsWDpJqEGQ- X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4341 Date: 2004-09-28T23:52:13+02:00 List-Id: Hi, I am starting to read a bit about generic programming and I am a bit confused from it, cause it seems to me a bit different to template-programming in C++. Sadly I can't figure out the difference between the following: 1.) generic type Element is private; package MyContainers is type MyContainer is private; procedure Some_Proc(Item : Element); end MyContainer; 2.) generic type Element is private; package MyContainers is type MyContainer is private; generic with procedure Some_Proc(Item : Element); end MyContainer; I only have seen the "with procedure/function..." in the following sense: generic type T is private; with procedure Some_Proc(Item : Element); And I thought the sense of this is to tell the compiler that T has to declare the procedure Some_Proc, so that I can write in the body of my package something like: .... Item1, Item2: Element ... Item1.Some_Proc(Item2); I sadly don't understand when to use the 2. case? Thanks in advance, Rick