This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
deeper constification
- To: guile at sourceware dot cygnus dot com
- Subject: deeper constification
- From: Michael Livshin <mlivshin at bigfoot dot com>
- Date: 29 Mar 2000 19:47:44 +0200
- Organization: who? me?
1.
I'd like to make a change so that SCM_CAR, SCM_CELL_WORD* etc. will no
longer return proper lvalues. well, not exactly -- they'll return
lvalues, but assignment to these lvalues will cause a compiler
warning. this is needed to make sure that all modifying accesses are
done through the appropriate modifying macros, so that we'll have less
of a headache with the introduction of a generational GC.
all that is needed, actually, is a handful of changes like this one:
#define SCM_CELL_OBJECT(x, n) (((SCM *) SCM2PTR (x))[n])
becomes
#define SCM_CELL_OBJECT(x, n) (((const SCM *) SCM2PTR (x))[n])
any objections?
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?
--
Think of C++ as an object-oriented assembly language.