guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The relationship between SCM and scm_t_bits.


From: Paul Jarc
Subject: Re: The relationship between SCM and scm_t_bits.
Date: Mon, 03 May 2004 12:21:18 -0400
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

Marius Vollmer <address@hidden> wrote:
> For example, consider a list that is pointed to by a global variable
> and some fairly standard way of dealing with singly-linked lists in C:

I guess the simplest solution would be "just don't do that".  (I.e.,
the C code would use an scm_t_bits* variable with
SCM_PACK/SCM_UNPACK instead of using SCM directly.)

> Luckily, code like this works on the platforms that Guile is used on,
> but it still is quite unclean, I'd say.

I agree.

> We could make a new guarantee that says that SCM_SET_SMOB_DATA (etc)
> can store any pointer that is cast to a scm_t_bits and any integer
> that fits into 'unsigned int', say.

That would be enough for my code, I think.  Of course it should remain
source-compatible, too:
#define SCM_SET_SMOB_DATA(smob, bits) SCM_SET_SMOB_OBJECT(smob, SCM_PACK(bits))

> Should we (gradually and with deprecation and everyhing) remove
> scm_t_bits from the smob API completely?  I have not thought this
> thru, but we might and with something that is not really an
> improvement, just different.

I think it would be an improvement, in conceptual cleanliness if
nothing else.  It'll make the C interface that much easier to work
with.


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]