]> git.donarmstrong.com Git - lilypond.git/blob - lily/scope.cc
f578433a800d1e39ec5d8e71a96e6adfde95a3b3
[lilypond.git] / lily / scope.cc
1 /*   
2   scope.cc --  implement Scope
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "scope.hh"
11 #include "string.hh"
12 #include "scm-hash.hh"
13
14 Scope::Scope (Scheme_hash_table * st)
15 {
16   assert (st);
17   id_dict_ =st;
18 }
19
20 bool
21 Scope::elem_b (String s) const
22 {
23   return id_dict_->elem_b (ly_symbol2scm (s.ch_C ()));
24 }
25
26 bool
27 Scope::elem_b (SCM s) const
28 {
29   return id_dict_->elem_b (s);
30 }
31
32
33 SCM
34 Scope::scm_elem (SCM s)const
35 {
36   return id_dict_->get (s);
37 }
38
39 SCM
40 Scope::scm_elem (String s) const
41 {
42  return scm_elem (ly_symbol2scm (s.ch_C ()));
43 }
44
45
46 void
47 Scope::set (String s, SCM id)
48 {
49   return id_dict_->set (ly_symbol2scm (s.ch_C ()), id);
50 }
51
52 SCM
53 Scope::to_alist () const
54 {
55   return id_dict_->to_alist ();
56 }
57
58 bool
59 Scope::try_retrieve (SCM k , SCM *v)const
60 {
61   return id_dict_->try_retrieve (k, v);
62 }
63