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-Thread: 103376,943350d29d278e69 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!feeder.erje.net!news2.arglkargh.de!news.tornevall.net!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Generic package with dynamic subprogram name? Date: Wed, 09 Jun 2010 16:37:41 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: 4f26e5401b3c13c0f76d041d535c3d11 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 4c2b56e7617665fe1a9dbaa04b52240c X-Complaints-To: abuse@tornevall.net User-Agent: Thunderbird 2.0.0.24 (X11/20100411) X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-Validate-Post: http://news.tornevall.net/validate.php?trace=4c2b56e7617665fe1a9dbaa04b52240c X-SpeedUI: 1738 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:12514 Date: 2010-06-09T16:37:41-07:00 List-Id: Marek Janukowicz wrote: > > generic > Attr : String; > package Get_Set is > function Get_Attribute return String; > procedure Set_Attribute ( Value : String ); > end Get_Set; > > But if I then instantiate: > package Get_Set_First_Name is new Get_Set( "FirstName" ); > package Get_Set_Last_Name is new Get_Set( "LastName" ); > > subprogram names will overlap. I know I can call them using package prefix, > but I'd really like to have nice API like here: > Get_First_Name( ... ); > Set_Last_Name( ... ); function Get_First_Name return String renames Get_Set_First_Name.Get_Attribute; procedure Set_First_Name (First_Name : in String) renames Get_Set_First_Name.Set_Attribute; -- Jeff Carter "I've got to stay here, but there's no reason why you folks shouldn't go out into the lobby until this thing blows over." Horse Feathers 50