2 scm-hash.hh -- declare Scheme hasher.
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
14 #include "lily-guile.hh"
19 auto resizing hash table.
21 1. ALWAYS USE THIS AS VIA A POINTER, i.e.
24 Scheme_hash_table * tab;
30 Scheme_hash_table tab;
34 2. UPON DESTRUCTION, DO
36 scm_gc_unprotect_object (tab->self_scm_);
43 - This should come from GUILE. We're typically doing double work,
44 because KEY already is a symbol, and is looked up in a symbol
47 - use GUILE hashtables iso STL.
50 class Scheme_hash_table
53 bool try_retrieve (SCM key, SCM *val);
54 bool elem_b (SCM key) const;
57 WARNING: putting something in assumes responsibility for cleaning
59 void set (SCM k, SCM v);
60 SCM get (SCM k) const;
63 void operator = (Scheme_hash_table const &);
64 Scheme_hash_table (Scheme_hash_table const &);
66 SCM to_alist () const;
71 DECLARE_SMOBS (Scheme_hash_table,foo);
75 #endif /* SCM_HASH_HH */