Hi Ingo, $COMP(p) is a member of a struct pdl_params_(your_opname), so it won’t persist outside that trans (aka PDL operation).
I don’t know how to be clearer than to ask you, once again, to look at how the GSL binding of INTERP operates. See https://github.com/PDLPorters/pdl/blob/master/Libtmp/GSL/INTERP/gsl_interp.pd#L346-L356 for the XS to create a persistent pointer accessible in Perl-land (and https://github.com/PDLPorters/pdl/blob/master/Libtmp/GSL/INTERP/gsl_interp.pd#L366-L372 to free it), the trivial typemap entry for GslAccel (the “OBJ” bit means the opaque pointer gets passed around as a blessed Perl IV, XS takes care of this all for you), and the use of OtherPars => “gsl_interp_accel *acc” then $COMP(acc) in the rest of the code. Best regards, Ed From: Ingo Schmid<mailto:ingo...@gmx.at> Sent: 08 March 2022 17:10 To: perldl<mailto:pdl-general@lists.sourceforge.net> Subject: [Pdl-general] otherpars and return value Hi, in which way can I pass back non-piddles from PP? Please provide a working example, I have tried for days and keep failing. See what I've tried so far. I can write to $COMP(p), use it either as value or pointer, all is well inside the Code=> part, but whatever I do is lost. I've tried passing as reference as well. Ingo
_______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general