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,9fa5063fbdc75ae4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 17:48:03 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F8F3C35.7080300@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: array of strings in a function References: <3F8EAB8F.8040901@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: rwcrnsc51.ops.asp.att.net 1066351683 24.34.139.183 (Fri, 17 Oct 2003 00:48:03 GMT) NNTP-Posting-Date: Fri, 17 Oct 2003 00:48:03 GMT Organization: Comcast Online Date: Fri, 17 Oct 2003 00:48:03 GMT Xref: archiver1.google.com comp.lang.ada:1035 Date: 2003-10-17T00:48:03+00:00 List-Id: Jeffrey Carter wrote: > So a negative Length is possible? And Contents (P, -27) is > meaningful? I think Length should return Natural, and Row should be > Positive. I'll buy that. The functions I supplied would raise Constraint_Error for a negative Row value. But not allowing a negative value is probably better. >> type Parameter_List is String; > > > This is not Ada. And making it "new String" won't work, either, since > Parameter_List is definite. So this proposal needs some work. > Perhaps "new Unbounded_String" is better. Oops! SUBtype Parameter_List is String; Or you can do "type Parameter_List is new String;" but that requires writing a lot of type conversions. > Something along these lines could work, perhaps using > Unbounded_String, but I wanted to point out to to the OP that this > won't work as given, and needs some work. Right, I didn't compile and test it, since I was just describing one way to approach the actual implementation. As I said, if I were doing it "for real" that way, I would probably use Reserved_128 or some such as a marker. -- 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