This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Scwm docstrings change
Michael Livshin <mlivshin@bigfoot.com> writes:
> mstachow@alum.mit.edu writes:
>
> > "Greg J. Badros" wrote:
> > >
> >
> > > I am unconvinced. The average C programmer shouldn't be reading the
> > > Guile source anyway. It's far more important that the invariants
> > > between the two parts be clearly intimately tied (and statically
> > > checked, though separating them would only complicate, not eliminate,
> > > the static checking that scwmdoc does).
> >
> > I don't think the checks are bad (as I said below). However, I don't
> > think making the checking slightly more difficult is a higher cost
> > than making the code even a bit less clear.
>
> um. while we are at it, while not have both options available? they
> both make sense, you know. for general C code that the user wants to
> make available to Guile, the "decoupled" declaration is best, but this
> doesn't mean that C routines written *just* for Guile need the
> verbosity and duplication, not to mention the very *internals* of
> Guile.
>
> so, the usage would be like:
>
> SCM_HOOKUP(c_name, "scheme-name", req_args_num, opt_args_num,
> rest_args_p, "doc-string");
> SCM
> c_name(<args>) {...}
>
> -and-
>
> SCM_PROC(c_name, "scheme-name", (req_args_decl), (opt_args_decl),
> (rest_arg_decl), "doc-string") {
> <stuff>
> }
>
> (don't kill me for the names).
>
> does the above make sense?
Both seems reasonable, but I'm still planning on converting the existing
primitives to the GUILE_PROC format that expands into a function
header. I'm not sure if you're trying to make a distinction between
req_args_decl and req_args_num, but it's not possible to make the macro
convert a list of arguments into the number of arguments without using
an external tool.
Greg