From: gressett@iglobal.net
Subject: Newbie question about Character range 'A' .. 'Z'
Date: 2000/05/16
Date: 2000-05-16T00:00:00+00:00 [thread overview]
Message-ID: <oum2isspkqhpga9c2tp630s0hast6caqoa@4ax.com> (raw)
I am learning Ada from the book Ada as a Second Language, by Norman
H. Cohen. (3rd printing)
In chapter 3, starting at the end of page 131 is a sample procedure,
Count_Letters, which contains errors which are corrected in the
errata page at the web site for the book. The problem it that
'A' .. 'Z'
is intended to be a Character range, but is ambiguous because it
cannot be distinguished from a Wide_Character range.
The errata page states that all occurrences of 'A' .. 'Z' should be
replaced with Character range 'A' .. 'Z', even in the line
if Next_Char in 'A' .. 'Z' then
where the declaration of Next_Char as a Character removes the
ambiguity. The errata page suggests that this is for consistency, as
the rules of the language do not require an explicit Character range
here.
The Gnat 3.12p compiler, however, prohibits the Character range,
producing the error message "range constraint not allowed in
membership test"
Is Gnat 3.12p being overly restrictive, or is the erratum wrong?
next reply other threads:[~2000-05-16 0:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-16 0:00 gressett [this message]
2000-05-17 0:00 ` Newbie question about Character range 'A' .. 'Z' Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox