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-08 07:16:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F841C3D.30007@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: Is the Writing on the Wall for Ada? References: <3F797748.3000203@noplace.com> <834clb.uan1.ln@skymaster> <3F79EF18.7060600@comcast.net> <3F7B1076.8060106@comcast.net> <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> <3F7C810E.7070100@comcast.net> <3F7E25C1.1060509@comcast.net> <3F7ECF99.8090004@comcast.net> <8qm2ov43djse19is7pk79jf5p7ifvvuff2@4ax.com> 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: rwcrnsc51.ops.asp.att.net 1065622613 24.34.139.183 (Wed, 08 Oct 2003 14:16:53 GMT) NNTP-Posting-Date: Wed, 08 Oct 2003 14:16:53 GMT Organization: Comcast Online Date: Wed, 08 Oct 2003 14:16:53 GMT Xref: archiver1.google.com comp.lang.ada:462 Date: 2003-10-08T14:16:53+00:00 List-Id: Dmitry A. Kazakov wrote: > What if 31 character length string is required? Now we have answered > the question, why Bounded_String was made generic - to avoid arbitrary > limitations like the number 30 in the example. I may be misunderstanding you. If you may be faced with a 31 character string (or any arbitrary length) then you should be using Unbounded_String. If there is a firm length limitation then it doesn't really matter, as far as the abstraction is concerned, if you put it in a variable, a named constant, a numeric literal, a subprogram parameter or a generic formal. Ada.Strings.Bounded uses a generic formal. The only thing to remember is that the size limit for a particular array type will be set when the element subtype is elaborated, even if the limit is taken from a variable. -- 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