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: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 17 Mar 2000 09:26:47 +0100
- Cc: Mikael Djurfeldt <djurfeldt at nada dot kth dot se>, guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0003170859130.1999-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> There are a lot of macros for predicates, which are either named SCM_XXXP
> or SCM_XXX_P. Unfortunately (IMO) lots of the more frequently used macros
> are named SCM_XXXP, while I think the SCM_XXX_P variant is better: For me
> it is better readable, it matches the scm_xxx_p naming scheme, and doesn't
> make constructs like SCM_GRPP (I made this up, just to show the idea) or
> other strange things necessary if there is some XXX which already ends
> with P.
I think we've used the convention for predicates specified in CLTL2:
A predicate is testing a certain concept. If the part of the name
denoting that concept is a single word, we put no _ before P, if it is
multiple words, we use _ :
SCM_KEYWORDP
SCM_IS_A_P
I personally find this nice because it's easier to write SCM_KEYWORDP
than SCM_KEYWORD_P and I actually find it more readable (because it's
easier for the brain to group it).
> Further, I'd love it if macros to create scheme values from C values would
> be named SCM_MAKE_... more consitently. Currently, we have SCM_MAKICHAR
> (OK, this one's been made deprecated), SCM_MAKINUM and others.
I agree.
> Also, some macros are used for symbols or keywords. The best solution
> would be to use a similar naming scheme for these also.
>
> It's good to talk about improving guile's API. A clean, consistent and
> beautiful api is, in my belief, important for guile's attractivity, and
> makes learning it easier.
Yes!