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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,43f6bd9b498b66d0 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!out02b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feeder.news-service.com!newsfeed-fusi2.netcologne.de!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 06 Mar 2008 10:32:26 +0100 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: default formal parameters in generic declarations References: <9b3bac4d-5ae1-4a1b-a81e-9aa9ae1843e0@e31g2000hse.googlegroups.com> <0078161e-64c7-4fa8-9794-b840d855a88b@q78g2000hsh.googlegroups.com> In-Reply-To: <0078161e-64c7-4fa8-9794-b840d855a88b@q78g2000hsh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <47cfba2a$0$14412$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 06 Mar 2008 10:32:26 CET NNTP-Posting-Host: 171cd799.newsspool3.arcor-online.net X-Trace: DXC=cA47`:n:i6P\9P[:DUn00QMcF=Q^Z^V3X4Fo<]lROoRQ4nDHegD_]RU>@L]d:eD9:]A:ho7QcPOVS8Y_O[Ki:BkS3LIHH:B:PP_ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:20191 Date: 2008-03-06T10:32:26+01:00 List-Id: Eric Hughes wrote: > Even with just two layer of instantiation this is feasible, but, in > the phrase I used earlier, "horribly klunky" (particularly with non- > linear references). So here's the biggest problem: You cannot get > simultaneously both arbitrarily deep layering and concision in formal > parameters for ordinary usage. By way of speculation, can nesting, to the extent it is absent from C++, lead to at least a partial solution of this problem? package News4 is type Performance_Tuning is interface; function Null_Tuning return Performance_Tuning'Class; generic Tuner: Performance_Tuning'Class := Null_Tuning; package B is generic Tuner: Performance_Tuning'Class := B.Tuner; package A is end; end B; end News4; To some extent, this view would require building software with "towers" of building blocks in mind, rather than patterns of cobblestone, so to speak. > As a coda, I wish to add that this practice is not hypothetical. The > sophistication of some of the generic (template) programming in the > Boost C++ library is excellent and worth imitating. Again by way of speculation, and as an example, the Boost parsing facilities have a counterpart in Ada that just works differently, using access to nested functions. GNAT.Spitbol.Patterns solves the same practical problems as the spirit parsers, and more. There might be a small overhead because pattern construction does not occur at compile time, but then Spitbol.Patterns is actually more powerful. I'm noting all this only because I should think there is some value in nesting that, just maybe, is easily overlooked.