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: stt@henning.camb.inmet.com (Tucker Taft) Subject: Re: Q: unboxed values and polymorphism Date: 1996/06/17 Message-ID: #1/1 X-Deja-AN: 160546562 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: henning.camb.inmet.com references: organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-06-17T00:00:00+00:00 List-Id: Hannes Haug (Hannes.Haug@Student.Uni-Tuebingen.de) wrote: : ... : Sort of. Fixnums are integers in the range -2^30 ... 2^30-1. Other : integers are interpreted as pointers to (or indices in arrays of) : bignums or list cells. And it is not a bad idea. : Jon> I'm not sure what it is you are trying to do. Make a list? : Jon> Make a generic list? Make a typed polymorphic list? Make an : Jon> untyped uncheckd programmer beware list? What? : I need it for my computer algebra nucleus. I need lisp-like dynamic : typing. I cannot use tagged records. This would make a list cell 50% : bigger. This would mean 33% less list cells. And this would mean 50% : more garbage collections. I also need the type information on the stack : for my garbage collector. I cannot use records for fixnums either. This : would mean a "new" for every operation. My nagation takes ca. 20 nsec : for fixnums on a 90MHz hyperSPARC. With a "new" this would be a not so : little bit slower. Perhaps the usage of records for fixnums would even : make some functions too big for inlining. Rather than tagged records, which allow for "unbounded" polymorphism, you might want to simply use a variant record. By using an appropriate record representation clause, you should be able to keep your list cells down to 2 words. You might still find a use for unbounded polymorphism (i.e. tagged records), when you point to larger objects which are not simply composted of list cells. However, if you are essentially implementing a variant of Lisp, then I doubt if tagged records will do much for you. Tightly encoded variant records seem more likely to be the answer. : - hannes -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Cambridge, MA USA