Hi, "Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes:
> On Wed, 9 Jul 2008, Greg Troxel wrote: >> Does C guarantee that pointers fit in unsigned long? > > I don't know. But in practice: Yes. That's usually the case but it's not guaranteed, which is why C99 provides `uintptr_t' in <stdint.h>. > Sure, if you just do this now and then, SMOBs aren't a problem. > But that doesn't change the fact that all the functionality SMOB > provides is overkill when the only thing you need is to hold > a pointer. It's not overkill, it's exactly what you need: disjoint SMOB type, `free' and `mark' procedures. > For those who needs the full functionality of SMOB's, or need > the extra speed and memory advantages of SMOB's, they are free > to use SMOB's. If not, the functions scm_to/from_uintptr > can be used instead, which is a billion times easier to use. Not really: as mentioned on `guile-devel', you'll need to implement that functionality (disjoint type, garbage collection) on top of your integer. One advantage is that this can be done in Scheme (except for the `mark' procedure, but it's not always needed); the main drawback in the context of Guile is poor performance. Thanks, Ludovic.