Hi Ed,

yes, I have been reading this file up and down. ;) Please take a look at
PDL::OCV, there's the pd file with XS and everything, I just can't get
it right for some reason, this is why I ask, sorry.

Ingo

On 3/8/22 18:23, Ed . wrote:

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:[email protected]>
*Sent: *08 March 2022 17:10
*To: *perldl <mailto:[email protected]>
*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
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to