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]

smobs


Hi!

Currently, the smob interface is a little bit problematic with respect to
type safety:  there are only macros of one kind (SCM_NEWSMOB and
friends) which don't care about whether they are going to store raw data
or SCM values.

Unfortunately, this can not be solved by simply providing a set of macros
for smobs with raw data and smobs with SCM values:  Since multi cells are
introduced there are too many possible combinations for this to make
sense.

We could (perhaps) use some kind of macro magic, like:

SCM_NEW_SMOB_3 (type, WORD, x, OBJECT, y, WORD, z)

which constructs the appropriate macros SCM_SET_CELL_WORD_1,
SCM_SET_CELL_OBJECT_2 and SCM_SET_CELL_WORD_3 based on the type tokens
given together with each date.

Currently, I can't think of a better solution.  Maybe anybody else can?

Another thing:  The term smob is somehow part of guile's history, but
since we are brainstorming about API issues anyway, wouldn't it make sense
to find some better name for it?  small objects - it's not really
appropriate.  If the smob interface will be changed, it would again be the
right time to think of something better.  (We can, as always, try to keep
things backwards compatible for some time.)

Best regards
Dirk Herrmann


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