This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Names in libguile
- To: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Subject: Re: Names in libguile
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Sat, 18 Mar 2000 11:11:18 +0100 (MET)
- cc: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>, Guile Mailing List <guile at sourceware dot cygnus dot com>
On 17 Mar 2000, Greg J. Badros wrote:
> Well you could rename them to scm_xxxx_s (i.e., append _s), but you
> aren't going to be able to make them scm_s_xxxx because I create then
> name using cpp pasting in snarf.h. see, e.g., the SCM_INIT macro
> there.
There is still another option: You could simply drop the scm_ prefix when
calling the macro, and then, instead of having
SCM_DEFINE (scm_xxx, ...
be transformed by
static const char s_ ## FNAME [] = PRIMNAME;
and scm_make_subr (s_ ## FNAME, TYPE, FNAME);
you could do
SCM_DEFINE (xxx, ...
and let this get transformed into
static const char scm_s_ ## FNAME [] = PRIMNAME;
and scm_make_subr (scm_s_ ## FNAME, TYPE, FNAME);
et voila!
This _may_ be a win, because when applied consistently, the macros in
snarf.h would automatically take care of choosing the right
prefix: SCM_SYMBOL could automatically provide scm_sym_, you simply could
not avoid it :-)
On the other hand, it may be confusing. It at least would require
documentation for the macros in snarf.h. Maybe, in general, there should
be a macro in snarf.h that allows to document macros?
Best regards
Dirk Herrmann