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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f2c8b37fdc73a652,start X-Google-Attributes: gid103376,public From: "Mark" Subject: Can Ada95 features replace the use of Ada 83 Varient records? Date: 1998/08/21 Message-ID: <01bdcd2f$a7da71f0$0f010180@nc84c>#1/1 X-Deja-AN: 383292752 X-NNTP-Posting-Host: lourow.demon.co.uk:212.228.41.146 X-Trace: news.demon.co.uk 903694752 nnrp-03:28363 NO-IDENT lourow.demon.co.uk:212.228.41.146 Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1998-08-21T00:00:00+00:00 List-Id: -- I'm new to Ada95 (Familar with 83) and thought that the use -- of varient records in Ada 83 can be replaced by Tagged types. -- Is it possible to implement the following using Ada 95 features? package Test is type Large_Data_Type is new Integer; -- large record normally type Rec (Changed : Boolean := False) is record case Changed is when TRUE => Data : Large_Data_Type; when FALSE => null; end case; end record; function Get return Rec; end Test; -- with Some_Other_Package; package body Test is Large_Data : Large_Data_Type := 1; function Get return Rec is Outside_Event : Boolean := false; -- Outside_Event : constant Boolean := Some_Other_Package.Event_Occured; begin case Outside_Event is when True => return ( Changed => True, Data => Large_Data); when False => return (Changed => False); end case; end Get; end Test;