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,bb6f4bd169077fb3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-23 13:59:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.gtei.net!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Representing data differently References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1046037580 12.234.13.56 (Sun, 23 Feb 2003 21:59:40 GMT) NNTP-Posting-Date: Sun, 23 Feb 2003 21:59:40 GMT Organization: AT&T Broadband Date: Sun, 23 Feb 2003 21:59:40 GMT Xref: archiver1.google.com comp.lang.ada:34490 Date: 2003-02-23T21:59:40+00:00 List-Id: >>In C I can represent the same data multiple ways using structs and >>unions. How and can I do this in Ada? Sometimes the item that tells which part of the union to use is actually nearby, and you can just use a straight Ada discriminated record. Another possibility is to use a discriminated record where a case statement on the discriminant tells which of several pointers to use to point to the actual C data.