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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: What do you think about this? References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com> <17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com> <86y4jaqzdx.fsf@stephe-leake.org> <86oak5qulb.fsf@stephe-leake.org> Date: Thu, 25 Jun 2015 08:16:30 -0500 Message-ID: <86k2usq66p.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) Cancel-Lock: sha1:SzorhC5gDU47A9CMzhqJa7pF014= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 2d3b8558bff30e97f808430974 X-Received-Bytes: 2059 X-Received-Body-CRC: 220383003 Xref: news.eternal-september.org comp.lang.ada:26472 Date: 2015-06-25T08:16:30-05:00 List-Id: "Jeffrey R. Carter" writes: > On 06/24/2015 03:17 AM, Stephen Leake wrote: >> Laurent writes: >> >>> CMI_Type is ("<=1","0,004","3"); or CMI_Type is ("1","2","3"); >> >> This is not an enumeration; it is an aggregate of strings. In Ada you >> can do this as: > > Actually, it's invalid. > >> type CMI_Type is array (Integer range <>) of access constant String; >> >> CMI_1 : constant CMI_Type := (+"<=", +"0,004", +"3"); > > This is a terrible idea. As compiler writer, ARG member, and ARM editor Brukardt > said recently in another thread, anonymous access types are evil. This is one place they are very useful. > I would even > argue against a named access type for this, since unbounded strings are > available. In this case, the OP has an instance of bounded strings available and > would probably want to use that. That makes them non-constant, which is certainly _not_ the intent! -- -- Stephe