This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Suggestion: new snarf macro set
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> So why not just SCM_DEFINE_GENERIC_RELATION? Should be sufficient and is
> symmetric with the ACCUMULATION macros.
Maybe... I don't remember why I thought it's not good. It is natural
to define `<' by SCM_DEFINE_GENERIC_RELATION...
> The problem is here, that SCM_DEFINE_ as a prefix leads to the assumption
> that it is related to scheme's define, but the concept that we both have
> in mind here is actually a mixture between scheme and C level
> definitions. That's a matter of documenting the macros, though. (Or,
> maybe, a reason to look for a better prefix than SCM_DEFINE, but I can't
> think of anything more appropriate. Native speakers?)
That's what I thought originally. If the problem is the use of SCM_MAKE_,
we could use SCM_CREATE_ or something. How's that?
Also, I think it is a good idea to write docstrings for C functions/macros/
variables as well as Scheme's. For example, we could write
/*SCM_DOC: Execute @var{x} in the init function.
* ...
*/
#define SCM_SNARF_INIT(X) ...
and generate a docstring file in the same format as Scheme's. If that
happens, I can write Emacs commands `guile-c-describe' and others :)
> I think we do. My personal opinion (which I think goes along with common
> software engineering recommendations) is to keep scopes as small as
> possible in order to minimize dependencies between different units. As
> became obvious when I wanted to eliminate some of the macros in numbers.h,
> people tend to use things that are available, even if they are not part of
> an official API. (Don't want to pick on anybody here: We all know that
> Guile's official API has been quite vague for some time.)
Okay. This is my second suggestion:
SCM_SNARF_HERE
SCM_SNARF_INIT
SCM_SNARF_DOCS
SCM_DEFINE_PROCEDURE
SCM_DEFINE_PROCEDURE_ALIAS
SCM_DEFINE_RELATION
SCM_DEFINE_ACCUMULATION
SCM_DEFINE_GENERIC_PROCEDURE
SCM_DEFINE_GENERIC_RELATION
SCM_DEFINE_GENERIC_ACCUMULATION
SCM_DEFINE_GENERIC_C_FUNCALL (?)
SCM_DEFINE_SYNTAX
SCM_DEFINE_VARIABLE
SCM_DEFINE_STATIC_VARIABLE (This may be unnecessary?)
SCM_CREATE_OBJECT
SCM_CREATE_STATIC_OBJECT
SCM_CREATE_SYMBOL
SCM_CREATE_STATIC_SYMBOL
SCM_CREATE_KEYWORD
SCM_CREATE_STATIC_KEYWORD
The only name I don't like is SCM_DEFINE_GENERIC_C_FUNCALL. Is there
any better idea?
Thanks,
Keisuke Nishida