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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!nwrdny01.gnilink.net.POSTED!0f19ed38!not-for-mail From: "Frank J. Lhota" Newsgroups: comp.lang.ada References: <_Q%zc.7117$Wr.4869@newsread1.news.pas.earthlink.net> Subject: Re: A simple ADA puzzle (I haven't the answer) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: Date: Thu, 17 Jun 2004 14:20:23 GMT NNTP-Posting-Host: 141.154.58.140 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1087482023 141.154.58.140 (Thu, 17 Jun 2004 10:20:23 EDT) NNTP-Posting-Date: Thu, 17 Jun 2004 10:20:23 EDT Xref: g2news1.google.com comp.lang.ada:1623 Date: 2004-06-17T14:20:23+00:00 List-Id: "Jeffrey Carter" wrote in message news:_Q%zc.7117$Wr.4869@newsread1.news.pas.earthlink.net... > Frank J. Lhota wrote: > > > > If there is no reasonable upper limit on the LEN discriminant, if > > say LEN can vary from 1 to hundreds of thousands, then the best > > solution would be to use an array of pointers. This would be the only > > reasonable way to create an array of objects of widely varying sizes. > > For example: > > No, the best solution is to use Ada.Strings.Unbounded.Unbounded_String. Well, that depends. Determinig the best solution requires a lot of details not given in this thread. For example, is Abby required to use Ada 83? Is there a requirement to use STRING_TYPE? If the answer is "Yes" to either of these questions, then Unbounded_String is not a viable solution. Even if Abby is working in Ada 95 and is able to replace STRING_TYPE with something from the predefined library, it is not entirely clear that Unbounded_String is the best solution. If there is a reasonable upper bound on the length of the strings (say 60 characters), then Bounded_String would be be a faster solution. As always, all of this depends on one question: what is this software supposed to do?