Hey porters - I've written some code (in a library that I intend to release this summer) that makes extensive use of the PMCode key, which I discovered when I looked up the code for fibonacci. Of course, PMCode is not even mentioned as undocumented in the PDL::PP documentation. I'd like to change that by adding an item to the list in the first appendix that reads like this:
=item PMCode Used to create genuine Perl code to interface to your function and hide direct access to your PP function. PP's normal behavior defines an XS function that Perl binds your PP functionality, bypassing a Perl wrapper completely. A lot of work goes into making these XS functions flexible, but if you need to do something that PP cannot handle, the PMCode key lets you define your own snippet of Perl code. In the PMCode section, you should define a Perl sub with the name of your function. You can access the actual PP function by calling its mangled name: C<< PDL::_<funcname>_int >>. (Note: PDL::PP doesn't always create low-level name mangled functions; it only does this for functions that make use of the PMCode section.) For a simple example of working code, see the definition of fibonacci in the .pd file for PDL::Primitive. I don't know about anybody else, but this feels a bit clunky to me. What do you think? Should I write more? Is anything misleading? Should I provide an example directly in the docs? Thanks! David -- Sent via my carrier pigeon. _______________________________________________ PDL-porters mailing list PDL-porters@jach.hawaii.edu http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters