This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: struct interface
Michael Livshin <cmm@verisity.com> writes:
> Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
>
> > What is pathologic? To mix SCM values with other types in a struct?
> > I don't think so.
>
> nor me. but to not word-align SCM's is pathologic (at least in
> objects that sit in memory and that you work with).
I don't want to introduce complexity in the user interface. One
should be able to write things like:
struct foo {
char c;
SCM s;
}
and rely on that this will work whatever architecture you're running
on.
If we require users to do explicit padding, I think this will become a
common source of bugs.
Also, I don't see any big reason why we couldn't support non-aligned
SCM words. As I said earlier, we can use a separate set of macros for
this type of access.