comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+valid_for_reply_from_news@pvv.org>
Subject: Re: Variant records..
Date: Tue, 17 Feb 2004 15:43:42 +0000 (UTC)
Date: 2004-02-17T15:43:42+00:00	[thread overview]
Message-ID: <slrnc34dle.k4o.randhol+valid_for_reply_from_news@k-083152.nt.ntnu.no> (raw)
In-Reply-To: e8f9995c.0402170637.a6d7697@posting.google.com

On 2004-02-17, Ganesh Ramasivan <ganesh.ramasivan@gdcanada.com> 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."



  reply	other threads:[~2004-02-17 15:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-15 22:51 Variant records Ganesh Ramasivan
2004-02-16 10:57 ` Preben Randhol
2004-02-16 15:25   ` Ganesh Ramasivan
2004-02-16 15:46     ` Ludovic Brenta
2004-02-16 16:16     ` Preben Randhol
2004-02-17 14:37       ` Ganesh Ramasivan
2004-02-17 15:43         ` Preben Randhol [this message]
2004-02-16 16:59   ` Ganesh Ramasivan
2004-02-16 20:14     ` Simon Wright
2004-02-17 14:56       ` Ganesh Ramasivan
2004-02-17 15:31         ` Robert I. Eachus
2004-02-16 23:17 ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
1999-09-14  0:00 Variant Records Shawn Barber
1999-09-14  0:00 ` Mark Lundquist
1999-09-14  0:00 ` David C. Hoos, Sr.
1999-09-14  0:00 ` Matthew Heaney
1986-10-31  9:08 variant records Dean Luick
1986-11-03 14:17 ` Bev Sobelman
1986-11-05 16:35 ` stuart
1986-11-06 15:40 ` stt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox