Hugo <hv@crypt0.demon.co.uk> writes: >This XS code: > >int >MyClass::method() > >.. checks the THIS argument like this: > > if (sv_derived_from(ST(0), "MyClassPtr")) { > IV tmp = SvIV((SV*)SvRV(ST(0))); > THIS = INT2PTR(MyClass *,tmp); > } > else > croak("THIS is not of type MyClassPtr"); > >.. which is a problem, since the method will be invoked by perl on a >MyClass object, not on a MyClassPtr object. I'm not sure what the right >solution is for this - has anyone successfully used this type of >invocation? (I note that it does not appear to be documented in perlxs.) The whole MyClass * :-> MyClassPtr stuff is a mess. Just write your own typemap ;-) Or maybe just fake things so it _is_: package MyClass; @ISA = qw(MyClassPtr); > >Hugo -- Nick Ing-SimmonsThread Previous | Thread Next