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,9ce828272f314121 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.pionier.net.pl!news2.icm.edu.pl!not-for-mail From: "Staszek Goldstein" Newsgroups: comp.lang.ada Subject: Re: output and digits Date: Wed, 20 Apr 2005 21:53:23 +0200 Organization: http://news.icm.edu.pl/ Message-ID: References: NNTP-Posting-Host: systemy230.toya.net.pl X-Trace: achot.icm.edu.pl 1114026796 31991 217.113.225.230 (20 Apr 2005 19:53:16 GMT) X-Complaints-To: abuse@icm.edu.pl NNTP-Posting-Date: Wed, 20 Apr 2005 19:53:16 +0000 (UTC) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Priority: 3 X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MSMail-Priority: Normal Xref: g2news1.google.com comp.lang.ada:10614 Date: 2005-04-20T21:53:23+02:00 List-Id: Uzytkownik "Robert A Duff" napisal w wiadomosci news:wcc1x95361o.fsf@shell01.TheWorld.com... >> This works (if you correct it slightly to integer(character'pos('I')) - >> pos >> gives a universal integer!), but changing the order does not seem nice in >> a >> language like Ada... > > Oops. Yeah, 'Pos is what you want. But you don't need the conversion > to Integer. You are right, the representation clause accepts *any* integer type, even universal integers, nevertheless I had to add for Roman_Digit'size use 8; otherwise it complained that the two converted types have different sizes and gave no visible output. > Actually, it makes no sense to do arithmetic on roman numerals. > So if I were doing this, I would have two functions, for converting > integers to/from roman numerals represented as Strings. > You only need roman numerals for I/O. All internal processing > can be done in integers. I totally agree with this point of view. If fact, my roman numerals were given as an example only, in real life I had problems with output of DNA sequences, which is a more serious matter. Nevertheless, I feel quite satisfied now, after learning so many nice solutions to the problem... Staszek