* Re:casecrash: language lawyers: C'mon!
@ 2001-07-17 22:40 ANH_VO
0 siblings, 0 replies; only message in thread
From: ANH_VO @ 2001-07-17 22:40 UTC (permalink / raw)
To: comp.lang.ada
Your first problem, syntax violation, is at line 7, not line 11. Variable H
conflicts with enumeration value declared at line 3. Therefore, variable H havs
to be changed. Assume H is changed to H_Fix, then on line 11 change "when H" to
"when Record_Type' (H)". Of course, line 9 has to be adjusted to match line 7.
Below is the fixed code
with ada.text_io; use ada.text_io;
procedure Casecrash_Fix is
type record_type is (A,B,C,D,E,F,G,H,I,J,K,L,unknown);
type header is record
id_letter : record_type := unknown;
end record;
H_Fix : Header;
begin
case h_Fix.id_letter is
when A => put("a");
when Record_Type' (H) => put("h");
when others => put("*");
end case;
end Casecrash_Fix;--20010717ph+frehrmann
____________________Reply Separator____________________
Subject: casecrash: language lawyers: C'mon!
Author: Peter Hermann <ica2ph@iris16.csv.ica.uni-stuttgart.de>
Date: 7/17/01 12:58 PM
with ada.text_io;use ada.text_io;
procedure casecrash is
type record_type is (A,B,C,D,E,F,G,H,I,J,K,L,unknown);
type header is record
id_letter : record_type := unknown;
end record;
H : Header;
begin
case h.id_letter is
when A => put("a");
when H => put("h"); -- H conflict, name clash?
-- no context resolution?
when others => put("*");
end case;
end casecrash;--20010717ph+frehrmann
LRM:8.3(26), illegal homograph of H
LRM:8.6(28)
Why on earth should I accept this rule in this case?
Topic for Ada2005?
--
Peter Hermann Tel+49-711-685-3611 Fax3758 ica2ph@csv.ica.uni-stuttgart.de
Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
http://www.csv.ica.uni-stuttgart.de/homes/ph/
Team Ada: "C'mon people let the world begin" (Paul McCartney)
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada
Received: from portal.udlp.com ([10.1.1.245]) by ccmail.udlp.com with SMTP
(IMA Internet Exchange 3.14) id 00750F39; Tue, 17 Jul 2001 08:01:44 -0500
Received: from portal.udlp.com (root@localhost)
by portal.udlp.com with ESMTP id IAA20549
for <anh_vo@udlp.com>; Tue, 17 Jul 2001 08:01:44 -0500 (CDT)
Received: from ada.eu.org (marvin.enst.fr [137.194.161.2])
by portal.udlp.com with ESMTP id IAA20537
for <anh_vo@udlp.com>; Tue, 17 Jul 2001 08:01:35 -0500 (CDT)
Received: from marvin.enst.fr (localhost [127.0.0.1])
by ada.eu.org (Postfix) with ESMTP
id 75725190BC; Tue, 17 Jul 2001 15:01:23 +0200 (CEST)
Path:
enst.fr!enst!freenix!fr.clara.net!heighliner.fr.clara.net!newsfeed.hanau.net!new
sfeed01.sul.t-online.de!t-online.de!dns.phoenix-ag.de!news.uni-stuttgart.de!not-
for-mail
From: Peter Hermann <ica2ph@iris16.csv.ica.uni-stuttgart.de>
Newsgroups: comp.lang.ada
Subject: casecrash: language lawyers: C'mon!
Organization: Comp.Center (RUS), U of Stuttgart, FRG
Lines: 28
Message-ID: <9j1cpn$bis$1@infosun2.rus.uni-stuttgart.de>
NNTP-Posting-Host: iris16.csv.ica.uni-stuttgart.de
User-Agent: tin/pre-1.4-980117 (UNIX) (IRIX/6.5 (IP22))
Xref: enst.fr comp.lang.ada:91336
To: comp.lang.ada@ada.eu.org
Sender: comp.lang.ada-admin@ada.eu.org
Errors-To: comp.lang.ada-admin@ada.eu.org
X-BeenThere: comp.lang.ada@ada.eu.org
X-Mailman-Version: 2.0.4
Precedence: bulk
Reply-To: comp.lang.ada@ada.eu.org
List-Help: <mailto:comp.lang.ada-request@ada.eu.org?subject=help>
List-Post: <mailto:comp.lang.ada@ada.eu.org>
List-Subscribe: <http://ada.eu.org/mailman/listinfo/comp.lang.ada>,
<mailto:comp.lang.ada-request@ada.eu.org?subject=subscribe>
List-Id: comp.lang.ada mail<->news gateway <comp.lang.ada.ada.eu.org>
List-Unsubscribe: <http://ada.eu.org/mailman/listinfo/comp.lang.ada>,
<mailto:comp.lang.ada-request@ada.eu.org?subject=unsubscribe>
List-Archive: <http://ada.eu.org/pipermail/comp.lang.ada/>
Date: 17 Jul 2001 12:58:31 GMT
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-17 22:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17 22:40 Re:casecrash: language lawyers: C'mon! ANH_VO
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox