lilypond-1.3.130
[lilypond.git] / lily / scope.cc
blob7ada75b65ddd222bccbde30dff5b83f0a8587b38
1 /*
2 scope.cc -- implement Scope
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 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);