Version 1.5 of acs/ac-00011.txt

Unformatted version of acs/ac-00011.txt version 1.5
Other versions for file acs/ac-00011.txt

!standard A.3.3 (09)          01-09-19 AC95-00011/01
!standard A.3.3 (11)
!class confirmation 01-09-13
!status received no action 01-09-11
!subject Does Latin_1 include literals such as 'A', 'a' and '0'?
!summary
!appendix

!topic does Latin_1 include literals such as 'A', 'a' and '0'?
!reference RM95-A.3.3(9), RM95-A.3.3(11),
!from Dan Eilers 01-09-19
!keywords Latin_1
!discussion

with ada.characters.latin_1;
package test is
  x: character := ada.characters.latin_1.'A';  -- legal?
  y: character := ada.characters.latin_1.'a';  -- legal?
  z: character := ada.characters.latin_1.'0';  -- legal?
end test;

RM95 A.3.3, defining package Latin_1, says:

para 9:
-- Decimal digits '0' through '9' are at positions 48 through 57

para 11:
-- Letters 'A' through 'Z' are at positions 65 through 90

Are these comments intended to mean that a reference to
Latin_1.'A' or Latin_1.'0' is allowed?  What about Latin_1.'a'?

The predefined operators in package Standard (RM 95 A.1) are
defined similarly, using comments.  But if the comments
in Latin_1 are intended to declare such literals, then the lower
case letters appear to have been overlooked.

I believe GNAT allows the definition of x and z, above, but not y.

****************************************************************

From: Robert Dewar
Sent: Wednesday, September 19, 2001 5:55 PM

I don't see an issue here. The lower case letters are not
overlooked, but deliberately omitted. The answer to Dan's
question simply seems to be

'A' yes
'a' no
'0' yes

Why would anyone think differently?

****************************************************************

From: Gary Dismukes
Sent: Wednesday, September 19, 2001 6:29 PM

Well, Latin_1 declares constants, not literals.  I've always thought those
comments were merely informative, indicating which literals are associated
with the character code slots not covered by constants in the package, not to
indicate the implicit declaration of character literals redundant with those
in Standard.  Seems like an unusual interpretation of the comments to me,
especially since the package is only described as declaring constants,
but I've been surprised before :-)

So my answer would be that there aren't any character literals in Latin_1.

****************************************************************

From: Robert Dewar
Sent: Wednesday, September 19, 2001 6:38 PM

In fact I reread Gary's message, and I agree, the answer is no for all these
cases, and that is the way things are defined in GNAT. So my previous message
is inoperable, the answer to all three questions is no. And that seems
perfectly fine to me.

****************************************************************

From: Randy Brukardt
Sent: Wednesday, September 19, 2001 6:29 PM

I agree completely with Gary. When I look at Latin_1, I see a package
specification including some comments. I don't see the comments as meaning
anything beyond comments.

Comments are always in italics in the RM (a feature that I had a heck of a
time reproducing when I converted the RM), so that isn't significant. Other
places in the standard where character literals are declared are explicit,
Standard for example.

So why would anyone expect any character literals in Latin_1??

****************************************************************

From: Tucker Taft
Sent: Thursday, September 20, 2001 10:16 AM

I agree with Gary, Randy, and Robert part 2.
There are no character types defined in Latin_1, and hence
no character literals.  If GNAT is allowing the 2 expressions
that Dan identifies, then it has a bug.

****************************************************************



Questions? Ask the ACAA Technical Agent