This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Names in libguile
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: Names in libguile
- From: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Date: 18 Mar 2000 09:44:42 -0800
- Cc: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>, Guile Mailing List <guile at sourceware dot cygnus dot com>
- References: <Pine.LNX.4.21.0003181055210.7582-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> 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?
It also complicates using tags since the full name of the procedure
won't appear on the line that begins the definition of the procedure.
(Not saying etags couldn't be coerced into doing the right thing, but it
does eliminate a fairly common invariant that is often relied upon.)
Greg