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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-10 10:40:20 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc53.POSTED!not-for-mail Message-ID: <3F86EEE3.4030600@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A nongeneric bounded string array type (was Re: Is the Writing on the Wall for Ada?) References: <3F7AC5B0.9080108@noplace.com> <3F7B7641.9030908@noplace.com> <3F7C8482.20102@comcast.net> <3F7D69EA.5030707@noplace.com> <3F7E2740.1050703@comcast.net> <3F7EBD85.8080205@noplace.com> <3F819C99.6080904@cogeco.ca> <3F844FE9.7030500@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc53 1065807619 24.34.139.183 (Fri, 10 Oct 2003 17:40:19 GMT) NNTP-Posting-Date: Fri, 10 Oct 2003 17:40:19 GMT Organization: Comcast Online Date: Fri, 10 Oct 2003 17:40:19 GMT Xref: archiver1.google.com comp.lang.ada:635 Date: 2003-10-10T17:40:19+00:00 List-Id: Warren W. Gay VE3WWG wrote: > I think your package is addressing some other poster's wishes here > I was simply referring to the need to instantiate different > bounded strings for _different_ variables. Arrays, of course > present another challenge, which is the problem you have proposed > a solution to. Ah, but I find I most often use Ada.Strings.Bounded for return values from database queries where you can get an arbitrary number of matches returned. The new package is perfect for that role, since I just have to with the package and not worry about setting maximum string lengths. > Well, I tend not to worry about this in my own projects, > since I prefer to look at the abstraction first, and implementation > last. But I did note that in one or two projects, > where I had a large number of instantiations, > that the code size started to look rather large compared to the > functionality that was being offered. This made me pause to > consider the ramifications of this on a truly large project. > I have also noted others mentioning similar concerns here. Depends on the compiler I guess, and whether they do some form of shared generics. It is fine with me if compilers create a new instance for each textual appearance of a generic with formal type parameters. But I expect that when I instantiate a generic in a nested context, that there will only be one code instance of the generic: procedure Foo(X: in Integer; ...) is package My_Bounded is new Ada.Strings.Bounded.Generic_Bounded_Length(X); ... begin... I often use that idiom for database queries. Since compilers have to support this in any case, I would expect them to try to share the code for other similar instances. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig