lilypond-1.3.154
[lilypond.git] / lily / scope.cc
blobf578433a800d1e39ec5d8e71a96e6adfde95a3b3
1 /*
2 scope.cc -- implement Scope
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "scope.hh"
11 #include "string.hh"
12 #include "scm-hash.hh"
14 Scope::Scope (Scheme_hash_table * st)
16 assert (st);
17 id_dict_ =st;
20 bool
21 Scope::elem_b (String s) const
23 return id_dict_->elem_b (ly_symbol2scm (s.ch_C ()));
26 bool
27 Scope::elem_b (SCM s) const
29 return id_dict_->elem_b (s);
33 SCM
34 Scope::scm_elem (SCM s)const
36 return id_dict_->get (s);
39 SCM
40 Scope::scm_elem (String s) const
42 return scm_elem (ly_symbol2scm (s.ch_C ()));
46 void
47 Scope::set (String s, SCM id)
49 return id_dict_->set (ly_symbol2scm (s.ch_C ()), id);
52 SCM
53 Scope::to_alist () const
55 return id_dict_->to_alist ();
58 bool
59 Scope::try_retrieve (SCM k , SCM *v)const
61 return id_dict_->try_retrieve (k, v);