home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!<UNAUTHENTICATED>+
- From: William.Lott@cs.cmu.edu
- Newsgroups: comp.lang.lisp
- Subject: Re: Calling C function from LCL
- Message-ID: <4eYpN3W00jeiEkhC8z@cs.cmu.edu>
- Date: 20 Aug 92 00:22:27 GMT
- Article-I.D.: cs.4eYpN3W00jeiEkhC8z
- References: <Bt8G1E.229@iai.kfk.de>
- <16u3jhINN9m1@early-bird.think.com>
- Organization: Carnegie Mellon, Pittsburgh, PA
- Lines: 19
- In-Reply-To: <16u3jhINN9m1@early-bird.think.com>
-
- barmar@think.com (Barry Margolin) writes:
- > Fixnums have the type tags 00 (positive fixnum) and 11 (negative fixnum);
- > this has the property that the tagged value is the result of an arithmetic
- > shift of the untagged value, which allows them to be added without
- > untagging, and multiplied by shifting the result rather than the arguments.
-
- Are those tags on the low end or high end of the word? If they are on
- the low end, then how does adding two negative fixnums result in
- anything useful (xxx11 + xxx11 = xxx10)? If they are on the high end,
- where does the shift come in?
-
- We [CMU Common Lisp, that is] use the low three bits as a type-tag,
- but have 000 for even fixnums and 100 for odd fixnums. In other
- words, if the low two bits are 00 then it is a fixnum with the value
- in the upper 30 bits. The implicit multiplication by 4 is handy when
- accessing arrays of word (4 byte) sized objects: it's pre-scaled.
-
- -William Lott
- CMU Common Lisp Group
-