Context::is_removable () const
{
return context_list_ == SCM_EOL && ! iterator_count_ &&
- !dynamic_cast<Score_context const*> (this)
- ;
+ !dynamic_cast<Score_context const*> (this);
}
void
Context::check_removal ()
{
- for (SCM p = context_list_; ly_c_pair_p (p); p = ly_cdr (p))
+ for (SCM p = context_list_; scm_is_pair (p); p = scm_cdr (p))
{
- Context *trg = unsmob_context (ly_car (p));
+ Context *trg = unsmob_context (scm_car (p));
trg->check_removal ();
if (trg->is_removable ())
SCM
Context::default_child_context_name () const
{
- return ly_c_pair_p (accepts_list_)
- ? ly_car (scm_last_pair (accepts_list_))
+ return scm_is_pair (accepts_list_)
+ ? scm_car (scm_last_pair (accepts_list_))
: SCM_EOL;
}
bool
Context::is_bottom_context () const
{
- return !ly_c_symbol_p (default_child_context_name ());
+ return !scm_is_symbol (default_child_context_name ());
}
Context*
Context::is_alias (SCM sym) const
{
if (sym == ly_symbol2scm ("Bottom")
- && !ly_c_pair_p (accepts_list_))
+ && !scm_is_pair (accepts_list_))
return true;
if (sym == unsmob_context_def (definition_)->get_context_name ())
return true;
Context * found = 0;
for (SCM s = where->children_contexts ();
- !found && ly_c_pair_p (s); s = ly_cdr (s))
+ !found && scm_is_pair (s); s = scm_cdr (s))
{
- Context * tr = unsmob_context (ly_car (s));
+ Context * tr = unsmob_context (scm_car (s));
found = find_context_below (tr, type, id);
}
return properties_dict ()->to_alist ();
}
-String
-Context::context_name () const
+SCM
+Context::context_name_symbol () const
{
Context_def * td = unsmob_context_def (definition_ );
- return ly_symbol2string (td->get_context_name ());
+ return td->get_context_name ();
}
+String
+Context::context_name () const
+{
+ return ly_symbol2string (context_name_symbol ());
+}
Score_context*
Context::get_score_context () const
{
- if (Score_context *sc =dynamic_cast<Score_context*> ((Context*)this))
+ if (Score_context *sc =dynamic_cast<Score_context*> ((Context*) this))
return sc;
+
else if (daddy_context_)
return daddy_context_->get_score_context ();
else
int
Context::print_smob (SCM s, SCM port, scm_print_state *)
{
- Context *sc = (Context *) ly_cdr (s);
+ Context *sc = (Context *) SCM_CELL_WORD_1 (s);
scm_puts ("#<", port);
scm_puts (classname (sc), port);