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 X-Google-Thread: 103376,cef8cda5553209f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-18 06:44:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!small.news.tele.dk!128.39.3.168!uninett.no!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Subtypes with Combined Ranges Date: Thu, 18 Jul 2002 15:44:35 +0200 Organization: UNI-C Message-ID: <3D36C643.6020703@nbi.dk> References: <3D36BD1F.9000101@yahoo.com> NNTP-Posting-Host: kaoslx07.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.net.uni-c.dk 1026999878 25688 130.225.212.98 (18 Jul 2002 13:44:38 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Thu, 18 Jul 2002 13:44:38 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 X-Accept-Language: Faeroese [fo],Danish [da],Norweg� Xref: archiver1.google.com comp.lang.ada:27223 Date: 2002-07-18T15:44:35+02:00 List-Id: David Rasmussen wrote: > An Ada-excercise reads as follows: > > 6.1 Write a program to count the number of occurrences of each letter of > the alphabet typed as input at the keyboard. Using a subtype of > Character as the index subtype of an array is a sensible way to do this. > > My first thought was to do this: > subtype Alphabetical is Character range 'A'..'Z' | 'a'..'z'; I think your problem is that you misunderstand the exercise. "The alphabet" is just 'a' to 'z' and case insensitive. But since the alphabet actually is 'a' to '�', and not just 'a' to 'z', the advise in the exercise is inapropriate for other languages than English and Latin. I would assume that the alphabet considered by the user is a subset of the type Character, but include all elements of type Character (converted to lower case) in the histogram, and not worry about which elements to show until printing out the histogram. Jacob -- "Any, sufficiently complicated, experiment is indistinguishable from magic."