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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,330ec86e1824a689 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-28 08:40:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "Robert C. Leif" Newsgroups: comp.lang.ada Subject: RE: Run-Time Type Assignment Date: Wed, 28 Aug 2002 08:39:07 -0700 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 1030549203 45395 137.194.161.2 (28 Aug 2002 15:40:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 28 Aug 2002 15:40:03 +0000 (UTC) Return-Path: X-Envelope-From: rleif@rleif.com X-Envelope-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <3D6CB4F5.F4E05D76@myob.com> Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.12 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:28504 Date: 2002-08-28T08:39:07-07:00 From: Bob Leif To: SK et al. How does your solution work, if the variants are: case Num_Parameters is when 1 => Parameter_1: Parameter_1_Type; when 2 => Parameter_1: Parameter_1_Type; Parameter_2: Parameter_2_Type; when 3 => Parameter_1: Parameter_1_Type; Parameter_2: Parameter_2_Type; Parameter_3: Parameter_3_Type; end case; This is the equivalent of a tagged type. Each succeeding variant includes all of its predecessor and one new element. I have made it work by defining new record types that include the elements for each variant. However, this is cumbersome. I will be testing the other suggestions. Thank you. -----Original Message----- From: comp.lang.ada-admin@ada.eu.org [mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of sk Sent: Wednesday, August 28, 2002 4:33 AM To: comp.lang.ada@ada.eu.org Subject: Re: Run-Time Type Assignment Hi, > type Parameter_Rec_Psuedo_Tagged_Type (Num_Parameters : Num_Parameters_Type) is --range 1..2 > record > case Num_Parameters is > when 1 => > Parameter_1: Parameter_1_Type; > when 2 => > Parameter_1: Parameter_1_Type; > --Parameter_1 conflicts with declaration 2 lines above. > --Can not have the same signature as the one above. > Parameter_2: Parameter_2_Type; > end case; > end record; type Disc_Rec ( Disc : Disc_Type) is record Parm1 : Parm1_Type; case Disc is when 1 => null; when 2 => Parm2 L Parm2_Type; end case; end record; Put common parameters in "common" area of record. -- ------------------------------------- -- Merge vertically for real address ------------------------------------- s n p @ t . o k i e k c c m -------------------------------------