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


Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:

> Just a question: If we're making an exception from the naming
> convention in order to be consistent with Scheme

My reading of R5RS is that they use the following convention:

Mutators: <collection type>-<operation>-<element type>!
Informators: <collection type>-ref-<element type>

Where <collection type> and/or <element type> is optional.

Examples:

collection type     operation   element type   
vector           -  set                       ! 
vector           -  ref             
                    set       - car           !
                    set       - cdr           !
                    set                       !
string           -  fill                      !

Someone wrote that the name "vector-set-element!" would be more
accurate.  True.  But the additional "-element!"  doesn't give the
human reader any additional information, so the name "vector-set!" is
probably better.

                  
R5RS doesn't have mutators where both, the collection type and
element type are implicit, but environments have:

eval-environment -  set      - imported       !
import-env.      -  set      - imports        !


BTW: Guile exports some functions which break this convention.  While
set-symbol-property! is correct, symbol-property-remove! is not.  In
an environment context their names are:
environment-set-symbol-property! and
environment-remove-symbol-property!


I also think it is better to use long descriptive names instead
of abbreviations.  The following for example should be MEGA OUT: 

scm_outp_port, IVDEP(test, line), RVREF(ra, i, e),
scm_ra_greqp. 


But the following macro name is absolutely okay:

SCM_INTERNATIONALIZATION_SET_CODE_BASE_FOR_SOMETHING(...)


Jost

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