From: Christophe R. <cs...@ca...> - 2010-04-10 18:21:03
|
Paul Khuong <pv...@pv...> writes: > In article <871...@ca...>, > Christophe Rhodes <cs...@ca...> wrote: >> I'm not sure why you think this is curious. It sounds like Waldek is >> saying that the in-memory representation of an sbcl bignum is >> sufficiently close to an in-memory representation of a gmp bignum that >> it's possible to pun them. The disadvantage of doing a principled >> translation between GMP structures and Lisp bignums is... > > It's not, unless you restrict yourself to positive integers. GMP integer > use a sign-magnitude representation, while we use 2's complement, > probably to simplify bit operations. Well, that's a shame :-) Oh well. Then sb-alien can be used to write support routines for automatic conversion to and from the GMP representation: defining alien type class methods for naturalize-gen and deport-gen (look at the c-string methods for inspiration). This would allow Waldek to have an integrated feel for whatever GMP calls he needs to make, I think. Best, Christophe |