Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by NetWallah (Canon)
on Aug 24, 2019 at 18:18 UTC ( #11104955=note: print w/replies, xml ) Need Help??


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

From the xs doc:
... The first blank line after the keyword will terminate the code block.

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

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

Replies are listed 'Best First'.
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
    ... 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.

    Cheers,
    Rob
      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 build.pl 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 :-(

        Cheers,
        Rob

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2019-10-17 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?