This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Names in libguile


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]