This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Using SCMs as hash keys
- To: guile at sourceware dot cygnus dot com
- Subject: Using SCMs as hash keys
- From: Andrew Chadwick <andrew dot chadwick at symbian dot com>
- Date: 21 Jan 2000 15:48:16 +0000
Hi,
I'm working on a project where I need to use SCMs as the keys of a
hash table implemented in C to refer to values which are C structs.
The keys need to be retrievable as a list from the Guile environment,
which will eventually runs in a separate thread from the C bit of the
program.
I know that a SCM is a long with type bits, and I'll be doing a
scm_protect_object on each key as it gets added. g_int_hash() and
g_int_equal() seem to do the right thing on my system. Are there any
issues involved with pulling out these SCMs and exporting them back to
the Guile environment in a list?
FYI, this is with glib version 1.2.6 and Guile 1.3.4.
Could you please send or Cc: any replies to my home address,
atc-at-piffle.force9.co.uk? Thanks.
--
Andrew Chadwick
System Documentation
Symbian Ltd.