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.102.21 with SMTP id a21mr5944312ioc.27.1510304373391; Fri, 10 Nov 2017 00:59:33 -0800 (PST) X-Received: by 10.157.12.211 with SMTP id o19mr343783otd.0.1510304373294; Fri, 10 Nov 2017 00:59:33 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!l196no1071274itl.0!news-out.google.com!193ni2646iti.0!nntp.google.com!l196no1071273itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 10 Nov 2017 00:59:33 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=57.79.21.10; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 57.79.21.10 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <734a413b-113b-4a30-98ef-9958e925ec75@googlegroups.com> Subject: Re: Choose between formal generic subprogram and subprogram access? From: gautier_niouzes@hotmail.com Injection-Date: Fri, 10 Nov 2017 08:59:33 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 1699 X-Received-Body-CRC: 2546407358 Xref: feeder.eternal-september.org comp.lang.ada:48800 Date: 2017-11-10T00:59:33-08:00 List-Id: > What are the good rules how to choose between formal generic subprogram vs > subprogram access argument/discriminant/field? If the subprogram is always needed, I opt for the generic way. There are some advantages: - no access - don't need to worry about a possible null or bad access - performance: if the subprogram is at the centre of an algorithm, it can be inlined and further optimized within the part of the program where the call is occurring. Of course the absence of access check and indirect call may help a bit. _________________________ Gautier's Ada programming http://sf.net/users/gdemont/