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: deeper constification


>>>>> "Dirk" == Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

    Dirk> We will, however, need some rules to make things consistent.
    Dirk> Guile will in any case provide a large API, consisting of
    Dirk> the scheme functions, the C functions and the C macros.
    Dirk> Some API elements have an equivalent on all three levels,
    Dirk> some don't.

Please opt for consistency among a particular class of "routines".  IE
All macros should be named one way and all functions should be named
one way.  Since you can't mix macro's and functions in C in any case,
I don't think the two naming schemes have to be the same.

When I'm writing relatively low level code so I need the scm_
interface, and I want to set a value I have to remember a few things.
First is the setter a macro or a function.  Then, what is the most
likely name.  Having remembered that the setter is a macro I'd like to
see that the names are quite predictable (either all SCM_SET_BLAH or
SCM_BLAH_SET).

    Dirk> I personally never had a problem with long names: You only
    Dirk> _write_ code once, but you and others will read it several
    Dirk> times.

    Dirk> Currently I am not decided yet about what I think of the _X
    Dirk> issue.  It would, however, not be a big problem to provide
    Dirk> additional _X macros for some time.

I think the "_x" should only be used to match an actual scheme
procedure name.  Since functions and macros cannot be interchanged I
think that *only* functions should be considered as matches for scheme
functions.  Following that logic, the names would be

set-cdr!            vector-set!
scm_set_cdr_x       scm_vector_set_x
SCM_SET_CDR	    SCM_SET_VECTOR

I think the "inconsistency" here is quite acceptable since C code is
quite different from scheme code.  

Thanks,

Clark



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