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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5f3fcf3eb242e4c1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-17 20:25:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: ANH_VO@udlp.com Newsgroups: comp.lang.ada Subject: Re:casecrash: language lawyers: C'mon! Date: Tue, 17 Jul 2001 17:40:27 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 995426737 44403 137.194.161.2 (18 Jul 2001 03:25:37 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 18 Jul 2001 03:25:37 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: Content-Description: cc:Mail note part 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 List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:10118 Date: 2001-07-17T17:40:27-05:00 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 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 ; 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 ; 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 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: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Date: 17 Jul 2001 12:58:31 GMT