chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Importing alien bignums


From: John Cowan
Subject: [Chicken-users] Importing alien bignums
Date: Tue, 13 Jun 2006 11:05:44 -0400
User-agent: Mutt/1.3.28i

My Q-language egg is coming along nicely, and I've run into an issue with
bignums vs. FFI.  When the numbers egg is installed, Chicken represents
bignums as mpz_t objects from the GMP.  Q has bignums as standard,
and uses the same representation and library.

However, there is not surprisingly no support for bignums in the FFI.
How can I persuade Chicken to treat a c-pointer coming from the FFI as an
(mpz_t *) and consider it to be a Scheme number?  (Obviously this would
only be done if the full-numeric-tower: feature is available.)

Naturally, bignums have to be copied both ways so that the two garbage
collectors don't collide.  

-- 
Take two turkeys, one goose, four               John Cowan
cabbages, but no duck, and mix them             http://www.ccil.org/~cowan
together. After one taste, you'll duck          address@hidden
soup the rest of your life.
        --Groucho




reply via email to

[Prev in Thread] Current Thread [Next in Thread]