This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: scm_intern_obarray_soft broken?
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: scm_intern_obarray_soft broken?
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 21 Mar 2000 20:18:44 +0100
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- References: <Pine.LNX.4.21.0003211607060.23194-100000@marvin.ida.ing.tu-bs.de>
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