comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Ambiguous expressions - Help!
Date: Tue, 24 Sep 2013 16:34:35 -0400
Date: 2013-09-24T16:34:35-04:00	[thread overview]
Message-ID: <wccr4ce2c2s.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 052de5da-75dc-486b-83e9-4f717d8e0ab7@googlegroups.com

Adam Beneschan <adambeneschan@aol.com> writes:

> A string literal can actually be converted to any array of an
> enumeration type, if the enumeration type has at least one character
> literal as one of its literals.  The classic example is:
>
>     type Roman_Digit is ('I', 'V', 'X', 'L', 'C', 'D', 'M');
>     type Roman_Numeral is array (Natural range <>) of Roman_Digit;
>     R : Roman_Numeral := "MMXIII";

Right, and it's interesting that Roman_Digit'Size = 3 bits,
and the representation of 'I' is 0, 'V' is 1, ..., 'M' is 6.

- Bob

  reply	other threads:[~2013-09-24 20:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 17:38 Ambiguous expressions - Help! Mike H
2013-09-24 18:15 ` Eryndlia Mavourneen
2013-09-24 18:43   ` Adam Beneschan
2013-09-24 20:34     ` Robert A Duff [this message]
2013-09-24 18:37 ` Jeffrey Carter
2013-09-24 21:08 ` Georg Bauhaus
2013-09-25  7:14 ` Mike H
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox