type = get_translator (definition);
else if (ly_is_pair (definition))
{
- type = get_translator (ly_symbol2scm ("Scheme_engraver"));
is_scheme = true;
}
else if (ly_is_procedure (definition))
// an argument and evaluates to an a-list scheme engraver
// definition.
definition = scm_call_1 (definition, cs);
- type = get_translator (ly_symbol2scm ("Scheme_engraver"));
is_scheme = true;
}
- if (!type)
+ if (!is_scheme && !type)
warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
else
{
- Translator *instance = type->clone ();
- if (is_scheme)
- dynamic_cast<Scheme_engraver *> (instance)->init_from_scheme (definition);
+ Translator *instance = is_scheme ? new Scheme_engraver (definition)
+ : type->clone ();
SCM str = instance->self_scm ();
const char Translator_group::type_p_name_[] = "ly:translator-group?";
int
-Translator_group::print_smob (SCM port, scm_print_state *)
+Translator_group::print_smob (SCM port, scm_print_state *) const
{
scm_puts ("#<Translator_group ", port);
scm_puts (class_name (), port);
}
SCM
-Translator_group::mark_smob ()
+Translator_group::mark_smob () const
{
derived_mark ();
scm_gc_mark (protected_events_);