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 16:37:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F849F9F.7040108@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: <3F7B1076.8060106@comcast.net> <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> <3F7C810E.7070100@comcast.net> <3F7E25C1.1060509@comcast.net> <3F7ECF99.8090004@comcast.net> <8qm2ov43djse19is7pk79jf5p7ifvvuff2@4ax.com> <3F841C3D.30007@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: rwcrnsc52.ops.asp.att.net 1065656248 24.34.139.183 (Wed, 08 Oct 2003 23:37:28 GMT) NNTP-Posting-Date: Wed, 08 Oct 2003 23:37:28 GMT Organization: Comcast Online Date: Wed, 08 Oct 2003 23:37:29 GMT Xref: archiver1.google.com comp.lang.ada:505 Date: 2003-10-08T23:37:29+00:00 List-Id: Dmitry A. Kazakov wrote: > A clear deficiency is an inability to constrain [*all*] the array > elements through a discriminant. > > This in turn makes a non-generic implementation of Bounded_String less > usable. An example of use: > > type Array_Of_Bounded_Strings (Max_Length : Natural) is > array (...) of Bounded_String (Max_Length); > > Where is any limit here? Um, that the syntax is not legal Ada? If you look at my recent post you will see that you can do something which actually creates what you want. And notice that since the type Bounded_Array is totally non-generic, you can write a function that returns an object of type Bounded_Array assign it to a variable, then operate on that: Name_List: Bounded_Array := Get_Names(...); Since Name_List will take its bounds from the return value of Get_Names, Get_Names can be written to return a Bounded_Array where the maximum length is chosen based on the strings to be returned. To go back to an earlier question, if your query matches twelve names, and the longest name matched has length 31, then Name_List.Size = 12, and Name_List.Max = 31. -- 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