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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,499373c5a06cccc1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-17 07:43:43 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tdcnorge.no!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Variant records.. Date: Tue, 17 Feb 2004 15:43:42 +0000 (UTC) Organization: PVV Message-ID: References: NNTP-Posting-Host: k-083152.nt.ntnu.no X-Trace: tyfon.itea.ntnu.no 1077032622 3241 129.241.83.152 (17 Feb 2004 15:43:42 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Tue, 17 Feb 2004 15:43:42 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:5637 Date: 2004-02-17T15:43:42+00:00 List-Id: On 2004-02-17, Ganesh Ramasivan wrote: > Sorry, but I don't see why you think this won't compile. I tried it > and it does compile. Which compiler are you using? Compiling the program (see below for the exact source code) I get: % gnatmake variant.adb gnatgcc -c variant.adb variant.adb:22:27: "MAN" is undefined gnatmake: "variant.adb" compilation error =8<============================================================= procedure Variant is type Vehicle_Type is (CAR, LEGS, BIKE, PLANE); type Vehicle_Power is (MANUAL, AUTOMATIC); type Foo(Vehicle : Vehicle_Type; Power: Vehicle_Power) is record case Vehicle is when CAR => null; when LEGS => null; when BIKE => null; when PLANE => null; when others => null; end case; end record; Audi : Foo(Vehicle => MAN, Power => MANUAL); begin null; end Variant; -- "Saving keystrokes is the job of the text editor, not the programming language."