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]

Re: scm_intern_obarray_soft broken?


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> scm_intern_obarray_soft seems completely broken to me

That's a normal reaction. :)  


> called in order to enter a symbol into scm_symhash, we may actually end up
> with the symbol entered in scm_weak_symhash.

scm_weak_symhash is used to make symbols globally unique. The other
obarray "scm_symhash" only belongs to the default module.

When guile compares two symbols, it compares their scm_weak_symhash
locations, not their hash values.


> seems like this could cause data to be garbage
> collected which wasn't intended to be.

That's exactly the question I asked Marius Vollmer when I started.
The answer is simple: symbols do not carry any data except their
hash value.  If you want to associate a value to a symbol, you have
to provide a location in a obarray, scm_symhash for example.


Jost

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