guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easiest way to set procedure-documentation?


From: Roland Orre
Subject: Re: Easiest way to set procedure-documentation?
Date: Wed, 16 Oct 2013 13:49:53 +0200

Thanks for the hint Andy. However, for now I've made a patch of
SCM_DEFINE and SCM_PROC, actually as SCM_PUBLIC_DEFINE as well as
SCM_PUBLIC_PROC (to not collide with SCM_DEFINE_PUBLIC) as well as
SCM_PUBLIC_CONST and SCM_PUBLIC_SUBR (same as PROC but with doc and
C-parameters (as the DEFINE macro) for generation of library link
references) and SCM_PUBLIC_SYNTAX which adds procedure or object
documentation as well as automatic c-export of symbols and generation
of include files to be included by other modules linking to other user
modules on the fly from the snarf preprocessing.
The external file is great when development has stabilized and docs,
parameters and such do not change often/much, but with hundreds of
routines and plenty of modules it is hard to maintain same info at
many places at once.
My modified snarf macros generate a module.xp which contains extern
declaration of the routines and constants apart from the module.x as
well as a libmodule.h, where one part is static (libmodule.hin) and
the rest generated from the macros. I'll send them up for evaluation
soon if you consider them interesting.
I also added a routine load-module-library where you just give the init entry as
(load-module-library "scm_init_user")
which uses the module name to load libuser.so  so the file, in this
case, user.scm which is loaded when  doing (use-modules (user))
basically only needs to contain that single line (load-module-library
"scm_init_user") and all exports are made automatically (as when using
in SCM_DEFINE_PUBLIC, but what was missing was similar for PROC,SYNTAX
and CONST).

On Sat, Sep 7, 2013 at 11:42 AM, Andy Wingo <address@hidden> wrote:
> Hi Roland,
>
> If you want to give documentation to procedures defined in C with
> SCM_DEFINE, you can associate an external documentation file with the
> module.  See
> http://git.savannah.gnu.org/cgit/guile-cairo.git/tree/cairo/Makefile.am
> and http://git.savannah.gnu.org/cgit/guile-cairo.git/tree/cairo.scm.
>
> A patch to the Guile manual would be wonderful :-)
>
> Andy
> --
> http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]