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]

deeper constification



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.

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