in reply to Math::BigInt::GMP - direct access to the gmp integer value
Probably, there's no elegant solution here. Math::BigInt::GMP encapsulates the mpz_t opaquely; is extending that not an option? I've no idea how perl modules should handle data sharing with friends.
Anyway, adding multiple magic is very simple with silly code:
Without the mg_virtual test your code would return NULL, and probably crash somewhere. That's the sort of thing that gives XS its bad rep. :|use Math::BigInt only => 'GMP'; use Devel::Peek; $$_ =~ m//g, Dump $_ for Math::BigInt->new(1)->{value};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Math::BigInt::GMP - direct access to the gmp integer value
by syphilis (Archbishop) on Jan 11, 2016 at 23:41 UTC |