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,5117b1b6391a0e06 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!news-xfer.newsread.com!nntp.abs.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Wed, 16 Jun 2004 14:31:50 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A simple ADA puzzle (I haven't the answer) References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1087410710.477506@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1087410710 10351 204.253.250.10 Xref: g2news1.google.com comp.lang.ada:1583 Date: 2004-06-16T14:31:50-04:00 List-Id: Frank J. Lhota wrote: > The problem with your definition of String_Type I don't know if you've been following the Improving Ada's Image thread, but this is a perfect illustration of what I said there - trying to handle strings in Ada is a nightmare if you don't understand a lot about arrays and types and constraints. New Ada users, especially those coming from C or Java, are going to be utterly confused. Just the fact that type LEN_TYPE is array (INTEGER range <>) of CHARACTER; type STRING_TYPE (LEN : INTEGER := 0) is record STRING : LEN_TYPE (1 .. LEN); end record; X : STRING_TYPE; can result in the allocation of all of memory is completely counterintuitive.