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-Thread: 103376,195f9d06474696b0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news.banetele.no!news.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Choice of variant record discriminant (design question) Date: Mon, 31 Oct 2005 16:53:48 +0100 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: dhcp236.dhcp.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: jacob-sparre.dk 1130774028 6748 172.24.5.236 (31 Oct 2005 15:53:48 GMT) X-Complaints-To: sparre@jacob-sparre.dk NNTP-Posting-Date: Mon, 31 Oct 2005 15:53:48 +0000 (UTC) User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:7pNYvowBWQ+cGgTLqnXhFSO20qE= Xref: g2news1.google.com comp.lang.ada:6075 Date: 2005-10-31T16:53:48+01:00 List-Id: Randy Brukardt wrote: > I have to wonder if the variant is worth it. There is not going to > be any space savings, Right. But I hardly ever use variant records to save space. > and in typical use, there isn't going to be much increase in safety, > either. Not that much, no. But I prefer to let the code match the logic of the problem. > So I'd probably give up on the variant in this case, because I'd > rather keep the aggregates (they are big help when a component needs > to be added). But only you can weight that trade-off, because the > relative value of the two options is something that depends on the > components and the intended uses. (If the "empty" variant wasn't > going to be empty in future version, for instance, the variant would > make more sense.) In this case, the null variant is most unlikely to end up containing data later, so I can not use the argument that I may save space later using this design. If I didn't use that Ada allows me to encode the logic of my problem in the source, couldn't I just as well use C or Fortran? Thanks for the advice, Jacob -- "Only Hogwarts students really need spellcheckers" -- An anonymous RISKS reader