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-Thread: 103376,7b5b3c67aa2a73fe X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s71.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Easy question about Character manipulation References: <1170100860.762334.13830@l53g2000cwa.googlegroups.com> <45bf39fd$1@news.post.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s71 1170267288 12.201.97.213 (Wed, 31 Jan 2007 18:14:48 GMT) NNTP-Posting-Date: Wed, 31 Jan 2007 18:14:48 GMT Organization: AT&T ASP.att.net Date: Wed, 31 Jan 2007 18:14:48 GMT Xref: g2news2.google.com comp.lang.ada:8781 Date: 2007-01-31T18:14:48+00:00 List-Id: Robert A Duff wrote: > > I agree that it should probably be constant, but why not give it a type, > as in: > > Size : constant Integer := 10; > > I think named numbers are a kludge, and should usually be avoided. I think they should be used whenever possible. >> emptySpaces : array (1..size) of Character := "0123456789"; >> textLine : array (1..size * 3) of Character; > > If Size is a named number, the index type of these arrays defaults to > Integer -- another language kludge. Right. All such ranges should be a discrete subtype, either by name or by being the part to the right of "is" in a subtype declaration: Integer range X .. Y; And there should be no anonymous types. -- Jeff Carter "Alms for an ex-leper!" Monty Python's Life of Brian 75