2 scm-hash.hh -- declare Scheme hasher.
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
16 #include "lily-guile.hh"
22 bool operator () (SCM s1, SCM s2) const
24 return long(s1) < long (s2);
28 typedef map<SCM,SCM, SCM_less> Scm_stl_map;
31 auto resizing hash table. This should come from GUILE.
33 1. ALWAYS USE THIS AS VIA A POINTER, i.e.
36 Scheme_hash_table * tab;
42 Scheme_hash_table tab;
46 2. UPON DESTRUCTION, DO
48 scm_unprotect_object (tab->self_scm_);
51 class Scheme_hash_table : private Scm_stl_map
54 bool try_retrieve (SCM key, SCM *val);
55 bool elem_b (SCM key) const;
58 WARNING: putting something in assumes responsibility for cleaning
60 void set (SCM k, SCM v);
61 SCM get (SCM k) const;
64 void operator = (Scheme_hash_table const &);
65 Scheme_hash_table (Scheme_hash_table const &);
67 SCM to_alist () const;
68 DECLARE_SMOBS(Scheme_hash_table,foo);
72 #endif /* SCM_HASH_HH */