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.68.201.134 with SMTP id ka6mr1706737pbc.4.1397590576281; Tue, 15 Apr 2014 12:36:16 -0700 (PDT) X-Received: by 10.50.25.4 with SMTP id y4mr1915igf.10.1397590576073; Tue, 15 Apr 2014 12:36:16 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!backlog3.nntp.ams3.giganews.com!backlog3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!xlned.com!feeder7.xlned.com!news.glorb.com!ur14no8637672igb.0!news-out.google.com!gi6ni469igc.0!nntp.google.com!ur14no8637664igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 15 Apr 2014 12:36:15 -0700 (PDT) In-Reply-To: <1ffb84f0-5e50-4807-90ff-dfdfac11c501@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <1ffb84f0-5e50-4807-90ff-dfdfac11c501@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <585c3cee-0c38-4aa3-b2f0-31bfae14714a@googlegroups.com> Subject: Re: Problem with generic package From: Adam Beneschan Injection-Date: Tue, 15 Apr 2014 19:36:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 2346 Date: 2014-04-15T12:36:15-07:00 List-Id: On Tuesday, April 15, 2014 11:26:49 AM UTC-7, Laurent wrote: > Hi > > As an exercise I have created a generic search function. Because my library folder begins to get messy I tried to put some related parts together in a package. > > https://github.com/Chutulu/Library.git > > The generic swap and sort are working as standalone but in my package I get this error: > > expect generic subprogram in instantiation > > No idea what the compiler tries to explain. > package body Array_Generics is > > procedure Swap_Generic (Value1, Value2 : in out Element_Type) is This is not a generic. Generics begin with the word "generic". Therefore, you can't instantiate it. It looks like you want to make this a generic and you want the generic type parameter to be called Value_Type. Try this: generic type Value_Type is private; procedure Swap_Generic (Value1, Value2 : in out Value_Type) is Temp_Value : Value_Type; begin -- Swap_Generic Temp_Value := Value1; Value1 := Value2; Value2 := Temp_Value; end Swap_Generic; -- Adam