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-16 15:17:11 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn53feed!worldnet.att.net!attbi_s51.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Variant records.. References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.161.24.134 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s51 1076973430 67.161.24.134 (Mon, 16 Feb 2004 23:17:10 GMT) NNTP-Posting-Date: Mon, 16 Feb 2004 23:17:10 GMT Organization: Comcast Online Date: Mon, 16 Feb 2004 23:17:10 GMT Xref: archiver1.google.com comp.lang.ada:5616 Date: 2004-02-16T23:17:10+00:00 List-Id: How about instead: type Vehicle_Type is abstract tagged null record; procedure Set_Speed(This : in out Vehicle_Type; S : in Speeds); function State_Of(This : Vehicle_Type) return States; type Vehicle_Power is (MANUAL, AUTOMATIC); type Car is new Vehicle_Type(Power : Vehicle_Power) with null record; procedure Shift_Gears(This : in out Car; New_Gear : Positive); type Man is new Vehicle_Type with null record; ... Audi : CAR(Power => MANUAL); John : Man; ... Set_Speed(Audi, 65); Set_Speed(John, 6); Shift_Gears(Audi, New_Gear=>2); Shift_Gears(John, New_Gear=>2); -- illegal