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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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!news1.google.com!proxad.net!usenet-fr.net!news.enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: output of enumeration types Date: Tue, 19 Apr 2005 19:40:44 -0400 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1113954071 18525 212.85.156.195 (19 Apr 2005 23:41:11 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 19 Apr 2005 23:41:11 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: "Staszek Goldstein" Return-Path: In-Reply-To: (Staszek Goldstein's message of "Tue, 19 Apr 2005 02:51:52 +0200") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:10589 Date: 2005-04-19T19:40:44-04:00 "Staszek Goldstein" writes: > This please quote enough so we can tell what you are refering to. > is also a nice idea, although for converting a string you still need > a function like the one given by Stephen Leake. It seems to me that > it should be possible to output the roman number as easily as it is > to output a string - there is no difference between the literals, > they both look exactly the same. As far as I can see, it is "just as easy". There is a package, that someone wrote, that does text output for type String. Since you are writing a new type, you need to write the output package for that as well. Once that is done, both are "just as easy" for anyone else to use. Note that Character has a special place in this discussion, since by definition it is what gets written to a "text" file. So to do "output" with Roman_Number, you must specify some way to convert its components to Character. Here's another tidbit that points out why "universal character" wont solve this problem: type Roman_Digit is (Foo,'V','X','L','C','D','M'); is a perfectly legal type declaration! -- -- Stephe