This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: deeper constification
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: deeper constification
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 30 Mar 2000 14:18:44 +0200
- Cc: Michael Livshin <mlivshin at bigfoot dot com>, guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0003301135130.20677-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> On 29 Mar 2000, Michael Livshin wrote:
>
> > #define SCM_CELL_OBJECT(x, n) (((SCM *) SCM2PTR (x))[n])
> >
> > becomes
> >
> > #define SCM_CELL_OBJECT(x, n) (((const SCM *) SCM2PTR (x))[n])
> >
> > any objections?
>
> I haven't tried it yet, but I don't see why it should be a problem. I
> will perform a test compilation with strict typing enabled and then tell
> you about the results.
>
> > 2.
> >
> > I'd like to change the low-level vector access macros in light of the
> > above. well, not exactly -- I'd actually like to introduce new pair
> > of element-wise access macros and to deprecate the SCM_VELTS thing
> > altogether. the only thing here I'm unsure about is the naming.
> >
> > should it be:
> >
> > SCM_VECTOR_REF/SCM_VECTOR_SET
> >
> > or
> >
> > SCM_VELT/SCM_SET_VELT
> >
> > or something else?
>
> If SCM_VECTOR_REF/SET will actually perform the equivalent to vector-ref
> and vector-set!, then I'm in favor of these. Otherwise, the names should
> be different in order to avoid confusion.
>
> Although these names do not match the suggested style to put the SET at
> the front of the identifier it may be better to keep them aligned to the
> scheme level names.
I agree with Dirk.
Just a question: If we're making an exception from the naming
convention in order to be consistent with Scheme, how do you feel
about the fact that we're anyway not using the Scheme name translation
convention? (SCM_VECTOR_SET vs SCM_VECTOR_SET_X)