ingydotnet / inline-c-pm

10 stars 19 forks source link

New recipe for the Inline::C Cookbook #56

Closed rongrw closed 7 years ago

rongrw commented 7 years ago

Hi all,

Following a recent discussion on the Inline mailing list about accessing Perl variables directly from a C function, I've put together some sample code that I think would be appropriate to add into the Inline::C Cookbook. I've attached a file in plain text format that contains the full recipe.

Would it be possible to add this new recipe into the Cookbook, perhaps under the "Meat & Potatoes" chapter?

Kind Regards, Ron.

C-Cookbook-entry.txt

mohawk2 commented 7 years ago

Hi Ron, this will probably be easier for the maintainers to process if you actually make a pull request with this?

wbraswell commented 7 years ago

@rongrw Good job on the new cookbook entry! :+1: I agree with @mohawk2, you should make a pull request.

rongrw commented 7 years ago

I've noticed that the Cookbook is in (.swim) format in the master branch. Sorry for asking these simple questions, but what is the (.swim) format and how do I convert it to (.pod) to ensure the formatting looks correct?

I'm assuming that I would have to add my new recipe into Cookbook.swim in order to create a pull request.

Thank you.

mohawk2 commented 7 years ago

That's a great question! As I recall, you have to install Zilla::Dist and do (I think) zild dist to make a .pm file you could inspect.

If that proves troublesome, then just a best guess at the formatting (since the markup is very easy to cargo-cult from other sections) and a PR is still much easier to deal with.

rongrw commented 7 years ago

Thanks for the suggestion @mohawk2

Another option is to install the Swim module. This module comes with a utility program called "swim" which can convert (.swim) format to (.pod) format as well as other formats. So, in my case, I use the following command:

swim --to=pod Cookbook.swim > Cookbook.pod

wbraswell commented 7 years ago

@rongrw As part of your documentation update, can you please include the above info (at least) about the Swim module?

rongrw commented 7 years ago

Hi @wbraswell ,

OK, that's fine. Do you think Swim together with the above command should be mentioned in an Appendix in the Cookbook?

daoswald commented 7 years ago

Is there not a CONTRIBUTING doc attached to the repo? That's where mention of swim would belong.

On Jan 21, 2017 7:26 AM, "Ron Grunwald" notifications@github.com wrote:

Hi @wbraswell https://github.com/wbraswell ,

OK, that's fine. Do you think Swim together with the above command should be mentioned in an Appendix in the Cookbook?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ingydotnet/inline-c-pm/issues/56#issuecomment-274264839, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2_-RyHsQDRaOiTFW4xPR_BLeDjkiifks5rUhV9gaJpZM4LQASA .

wbraswell commented 7 years ago

@rongrw There is not currently a CONTRIBUTING doc, but per @daoswald 's recommendation, you should go ahead and create one to contain your swim info.

rongrw commented 7 years ago

I have now finished my updates to Cookbook.swim. Also, I'm happy to write up a CONTRIBUTING file as suggested by @daoswald . I'll use Inline's version of this file as a guide.

Thanks for all your suggestions.

rongrw commented 7 years ago

I've now completed the CONTRIBUTING file. As I'm a little unsure with what I've written for this file, I've attached it to this post. If you could have a look at it that would be great. Let me know if it needs any further amendments or additions. Thank you.

CONTRIBUTING.txt

wbraswell commented 7 years ago

@rongrw Please add info about the IRC chat room to your CONTRIBUTING.txt file server: irc.perl.org channel: #inline

rongrw commented 7 years ago

Thank you @wbraswell for your suggestion.

I've added a section titled "IRC Chat Room" to the CONTRIBUTING file. I've also created a pull request now for updating the C-Cookbook.

perlpunk commented 7 years ago

i think this can be closed since the PR was applied

rongrw commented 7 years ago

@perlpunk , yes, it's fine to close this issue. Regarding having a CONTRIBUTING file in the repo, do you want me to create a new issue for this? Since I wrote this file back in Jan, I'm happy to do that. Thank you.

perlpunk commented 7 years ago

@rongrw yeah, that's probably a good idea. Since Dist::Zilla is already generating a generic CONTRIBUTING file for CPAN, it shouldn't be a problem to put that file into the repo, along with distribution specific advice. I'll try to talk to @ingydotnet later

rongrw commented 7 years ago

OK @perlpunk that's fine. We can use the generated CONTRIBUTING file - I'll then add a section on Swim since it's not obvious how to edit the Inline::C Cookbook file.