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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bdebc54a485c13a4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.235.4 with SMTP id ui4mr11945669pbc.3.1332525376544; Fri, 23 Mar 2012 10:56:16 -0700 (PDT) Path: kz5ni25087pbc.0!nntp.google.com!news1.google.com!news.glorb.com!news.netfront.net!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: My first compiler bug: work around or redesign? Date: Fri, 23 Mar 2012 10:56:15 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: NNTP-Posting-Host: 70.219.211.80 Mime-Version: 1.0 X-Trace: adenine.netfront.net 1332525376 8063 70.219.211.80 (23 Mar 2012 17:56:16 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Fri, 23 Mar 2012 17:56:16 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120310 Thunderbird/11.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-03-23T10:56:15-07:00 List-Id: On 03/23/2012 09:29 AM, Natasha Kerensikova wrote: > > However, at implementation level, it turns out that they are very > similar: only the prefix recognition change, and further processing is > perfectly identical. So instead of cut-and-pasting code, I would write a > generic that handles all the common aspects, using a formal function for > the prefix part. > > Is there something wrong with that approach? > Are there some caveat that I missed? > Are there advantages in avoiding the generics in that situation, for > example using a non-generic common function that takes an > access-to-subprogram extra parameter? There's nothing wrong with that approach. I've used it successfully many times. -- Jeff Carter "You couldn't catch clap in a brothel, silly English K...niggets." Monty Python & the Holy Grail 19 --- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---