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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c469fdacc2f3302b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!195.71.90.67.MISMATCH!news.unit0.net!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Dynamic Variant Record Creation Date: Wed, 17 Mar 2010 14:40:52 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Wed, 17 Mar 2010 14:40:52 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="21151"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Scxn6YCm58PsKhalmpx6QhLAfLqABiF8=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:IXlCc30f3YhNmK1byLZzyFN03/8= Xref: g2news1.google.com comp.lang.ada:9628 Date: 2010-03-17T14:40:52+00:00 List-Id: Jeffrey R. Carter expounded in news:hnov3m$t4o$1@tornado.tornevall.net: > Warren wrote: >> >> The other way for me to solve this is simply provide >> a discrimanant that only identifies the few variants. But >> to keep to 32-bits, I'd have to find a way to specify the >> discriminant as 3-bits, which I don't think is possible. > > Looking at what you have, it looks like a design problem to me. You > have a whole bunch of enumeration values, but you don't have a bunch > of variants. Yep. > I'd probably have an enumeration type with 3 values that > serves as the discriminant. Then have 3 enumeration types, one for > each variant, that gives the specific information that you're now > trying to use for the discriminant as well. I was considering that. In fact, I am still mulling over that possibility for the reason that the choice of "aux info" may change over time. For example a LEX_FLOAT may initially just point (by ID) back the collected string. Later it may convert to the actual binary value etc. So having an independed "representation" descriminant, may be the right way to go. > Whether you can encode that in a certain number of bits as you seem to > be trying to do is another question. Apparently, that can be done. Warren