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,8de933d44255f226 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Q: unboxed values and polymorphism Date: 1996/06/18 Message-ID: #1/1 X-Deja-AN: 161541341 references: organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-18T00:00:00+00:00 List-Id: Hannes says "But will this give me unboxed integers and type information on the stack ? I'd try a private type that's actually an integer. I'd use half of this integers (-2**30 ... 2**30-1) for my fixnums. Values outside this range would be indices in arrays of bignums or list cells. So I'd have unboxed integers and type information on the stack." You are encoding at a very low level, appropriate for C (since it is the only way to do things), but totally inappropriate for Ada. You need a variant record with a discriinant to indicate whether you have fixnums or indices. The discriminant would be a single bit.