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 20:19:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!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 20:18:36 -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 1030591142 47214 137.194.161.2 (29 Aug 2002 03:19:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 29 Aug 2002 03:19:02 +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 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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:28541 Date: 2002-08-28T20:18:36-07:00 From: Bob Leif To: Robert A Duff et al. I was being lazy. The actual parameters include unsigned 8, 16, and 32 bit integers; floats, one and two dimensional arrays, and possibly booleans. Fortunately, the array consists of one type of record, which can have 1 to approximately 15 fields (elements). The data type possibilities and number of elements in a record will increase as the technology advances. -----Original Message----- From: comp.lang.ada-admin@ada.eu.org [mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of Robert A Duff Sent: Wednesday, August 28, 2002 3:55 PM To: comp.lang.ada@ada.eu.org Subject: Re: Run-Time Type Assignment "Robert C. Leif" writes: > From: Bob Leif > From: Bob Leif > To: Fellow Readers of Comp.Lang.Ada > Firstly, thanks to all who suggested implementations. I now have a > solution based on the Example from Norman Cohen's Ada as a second > language page 377. > The two pages and main procedure below compile. Unfortunately, type > Para_Rec_Psuedo_Tagged_Type is brute force approach. Does anyone have a > simpler implementation? In this case, all the "Para"'s are of type Positive, so you could make an array inside the record, bounds 1..Num_Paras. You lose some range checking, unfortunately. If the types were not all the same type, then *make* them be all of the same type by the usual methods (pointer to class-wide, pointer to variant record, etc). SNIP including end.