unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Samuel Barreto <samuel.barreto8@gmail.com>
To: "guile-user\@gnu.org" <guile-user@gnu.org>
Subject: snarfing docstrings in c extensions
Date: Sat, 07 Apr 2018 20:59:32 +0200	[thread overview]
Message-ID: <m27epi6dwr.fsf@macbook-pro-de-samuel.home> (raw)

Hi everyone,

I'm trying to write a GSL wrapper in guile. I have written a lot of
simple functions using SCM_DEFINE and documented them using the last
SCM_DEFINE macro argument.

Now I'd like to make those docstrings accessible from Scheme code.
The way I do it for now is with this makefile instructions:

%.doc: %.c
	/wherevere/guile/source/code/is/libguile/guile-snarf-docs -o $@ $< \
	-- $(CFLAGS)

%.texi: %.doc
	cat $< | guild snarf-check-and-output-texi > $@

And then call makeinfo on it.
(I had to change some hardcoded path in the guile-snarf-docs scripts so
that it worked from another directory btw.)

So I do am able to generate the info files that I want. My two problems
are:

1. how to use guile-snarf-docs portably ? (I have hardcoded them in my
   Makefile for now.)
2. how to "link" them with functions defined in the extensions ? (I have
   tried to (set! documentation-files "PATH/TO/doc.txt") but I think I
   miss a step so that (procedure-documentation my-gsl-function) returns
   the docstring I want)

And from a broader perspective, is it the way it is supposed to work ? I
mean, am I doing it the right way or are other "guile-extension-writers"
doing it otherwise ?

Thank you for your help,
samuel



             reply	other threads:[~2018-04-07 18:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 18:59 Samuel Barreto [this message]
2018-04-08  2:27 ` snarfing docstrings in c extensions Mike Gran
2018-04-09  7:24   ` Samuel Barreto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27epi6dwr.fsf@macbook-pro-de-samuel.home \
    --to=samuel.barreto8@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).