Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Puzzled by the ListUtil.xs in Scalar-List-Utils-1.52.tar.gz

by syphilis (Bishop)
on Aug 25, 2019 at 00:55 UTC ( #11104968=note: print w/replies, xml ) Need Help??

in reply to Re: Puzzled by the ListUtil.xs in Scalar-List-Utils-1.52.tar.gz
in thread Puzzled by the ListUtil.xs in Scalar-List-Utils-1.52.tar.gz

... The first blank line after the keyword will terminate the code block

One of the the joys of having Inline::C write your XS files for you is that you never need to read the XS docs.
On the downside, if you then start messing around with the code in an XS file that was *not* created by Inline::C, you might end up asking a dumb question.

Thanks NetWallah, dave_the_m.

  • Comment on Re^2: Puzzled by the ListUtil.xs in Scalar-List-Utils-1.52.tar.gz

Replies are listed 'Best First'.
Re^3: Puzzled by the ListUtil.xs in Scalar-List-Utils-1.52.tar.gz
by NetWallah (Canon) on Aug 25, 2019 at 20:38 UTC
    That certainly was NOT a dumb question.

    It made me research XS and increased my awareness and knowledge of XS by an order of magnitude.

    Unfortunately, 0 * 10 **1 still == 0.

    Your last comment made me go lookup Inline::C, to try to understand how to generate XS from that.

    I did not see any links to examples and documentation of that use case.

    There is a brief mention in the Inline::C cookbook , but I was looking for some sort of tutorial. Can anyone point to a simple module that was developed this way, so I can study that as an example ?

                    "From there to here, from here to there, funny things are everywhere." -- Dr. Seuss

      When you run an Inline::C script with the CLEAN_AFTER_BUILD=>0; configure option you can then go into the _Inline/build directory and examine the files that Inline::C has generated - which includes the XS file.
      I actually always use InlineX::C2XS - which taps into Inline::C to generate the XS file (and, optionally, Makefile.PL, MANIFEST, test script).

      InlineX::C2XS is a module I wrote - it suits me but might not be to everyone's liking.
      There's a demo in the source(in the demos/context folder).
      The script therein (which is the script that you run) begins with use InlineX::C2XS qw(c2xs context context_blindly);.
      I think that needs to be changed to use InlineX::C2XS qw(c2xs context); - which is something I should fix :-(


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11104968]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2019-10-19 01:53 GMT
Find Nodes?
    Voting Booth?