This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: deeper constification
- To: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Subject: Re: deeper constification
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 31 Mar 2000 18:40:28 +0200
- Cc: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>, Michael Livshin <mlivshin at bigfoot dot com>, guile at sourceware dot cygnus dot com, djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0003301135130.20677-100000@marvin.ida.ing.tu-bs.de> <xy73dp8lkgr.fsf@mdj.nada.kth.se>
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