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,edafb2ab7e8839bc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Char type verification References: <1163628033.606530.190550@i42g2000cwa.googlegroups.com> <1163627827.1632.10.camel@localhost.localdomain> <1163632532.101867.123200@m73g2000cwd.googlegroups.com> In-Reply-To: <1163632532.101867.123200@m73g2000cwd.googlegroups.com> 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_s21 1163652515 12.201.97.213 (Thu, 16 Nov 2006 04:48:35 GMT) NNTP-Posting-Date: Thu, 16 Nov 2006 04:48:35 GMT Date: Thu, 16 Nov 2006 04:48:35 GMT Xref: g2news2.google.com comp.lang.ada:7491 Date: 2006-11-16T04:48:35+00:00 List-Id: KE wrote: > > It was intended as "How do you translate this example to Ada? How would > you, as a presumably experienced Ada coder, do it? What hoops would we > jump through? What this example does is output whether the 1st character of the 1st command-line argument is in the range 'A' .. 'Z'. In the Ada world, we tend to ignore the details of badly designed examples in poorly designed languages and simply implement the same functionality. Since there is no reason for your conversions and home-grown function, we're not going to waste effort translating them. I've been using Ada since 1984. I'm a SW engineer, not a coder. But as an experienced Ada SW engineer, how I would do it would look something like declare Arg : constant String := Ada.Command_Line.Argument (1); -- Presumably after making sure there is a 1st argument begin Ada.Text_IO.Put_Line (Item => Boolean'Image (Arg (Arg'First) in 'A' .. 'Z') ); end; -- Jeff Carter "From this day on, the official language of San Marcos will be Swedish." Bananas 28