This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: struct interface
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: struct interface
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 06 Apr 2000 11:44:10 +0200
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Cc: djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0004061117070.7086-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> What about putting all of these on a common base:
>
> SCM_MEMORY_WORD(p, n) --> (((scm_bits_t *) p) [n])
> SCM_MEMORY_OBJECT(p, n) --> (SCM_PACK (((scm_bits_t *) p) [n]))
> SCM_SET_MEMORY_WORD(p, n, v) --> (((scm_bits_t *) p) [n] = (v))
> SCM_SET_MEMORY_OBJECT(p, n, v) --> (((scm_bits_t *) p) [n] = SCM_UNPACK (v))
Regarding structs: As I've said earlier, structs will be replaced, so
it's probably waste of time change them.
Regarding your suggestion above: When we design the new record
representation, the "layouts" of objects should probably allow for SCM
values to be located non-word aligned within the object. This implies
that the index should be of unit `char' rather than `scm_bits_t *',
but maybe we should have a separate set of macros for this kind of
access.