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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9e124b142a146211 X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Re: Another Newbie question about interfacing to C Date: 2000/06/02 Message-ID: <3937A57B.11D12015@quadruscorp.com>#1/1 X-Deja-AN: 630190015 Content-Transfer-Encoding: 7bit References: Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 2 Jun 2000 12:19:44 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-06-02T12:19:44+00:00 List-Id: gressett@iglobal.net wrote: > Hmmm. Further study of the Cohen book causes me to believe that a > discriminant record type is what I need. It's interesting how C habits > can lead you into not seeing Ada stuff that is right under your nose. You might also try tagged records. You can declare some base type to be tagged record and create an access type which will point to elements of that class. Then anything you derive from that base type can be pointed to by the access type. That way, you can create arrays of pointers that will have heterogeneous collections of stuff. The routine you call to process the stuff can then take advantage of dispatching to automagically find the correct subprograms for processing the specific items passed. This may come a little closer in flavor to what you described than discriminated records do. Hope this is helpful MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Some people think programming Windows is like nailing jello to the ceiling... easy with the right kind of nails." -- Ivor Horton - Beginning Visual C++ 6 ======================================================================