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 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!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 23 Jun 2004 16:20:42 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1087410710.477506@master.nyc.kbcfp.com> Subject: Re: A simple ADA puzzle (I haven't the answer) Date: Wed, 23 Jun 2004 16:21:07 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-4Q9p088FvyzSeGwuNtWkUuql3dklHk07/DlQJlAEfGnSzbmN1GuQH8LCTQTl2/efQvQM3LaJb+ZlTJ5!s27M+tim6Pcef6CtK7v1EultwS4eiO4AEod98beYqu5WdYHu0POk+BhO8vQfI6WQyN4m48MYEucQ X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:1826 Date: 2004-06-23T16:21:07-05:00 List-Id: "Hyman Rosen" wrote in message news:1087410710.477506@master.nyc.kbcfp.com... > 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. And just plain wrong, IMHO. The decision to allow Ada 83 compilers to emasculate this critically useful feature was one of the worst made. (If that decision had not been made, we wouldn't really need Ada.Strings.Unbounded, among other things.) The original ACVC tests required this to work, and people put pressure on the AVO to get them removed. But, it's too late to reverse this decision (changing this has far reaching consequences in compilers, and that makes the cost too high to contemplate). Sigh. Randy.