X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fgrob-property.cc;h=f9773e5ec5a4878b12f66f1535970a5696e6ff8a;hb=166d6eab595c2e5a9a1538f9ab5a3810bd3f1b04;hp=3afe182c0ef07793ecf1fd0d09a5ea147c9bd4e1;hpb=01df8ad908c92687d0c352e5ad5f067e52809423;p=lilypond.git diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 3afe182c0e..f9773e5ec5 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -170,7 +170,7 @@ Grob::internal_get_property (SCM sym) const { programming_error (to_string ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)", ly_symbol2string (sym).c_str (), - name ().c_str ())); + name ().c_str ()));//assert (1==0); if (debug_property_callbacks) { message ("backtrace: "); @@ -181,6 +181,7 @@ Grob::internal_get_property (SCM sym) const if (is_unpure_pure_container (val)) val = unpure_pure_container_unpure_part (val); + if (ly_is_procedure (val) || is_simple_closure (val)) { @@ -321,9 +322,35 @@ Grob::internal_has_interface (SCM k) SCM call_pure_function (SCM unpure, SCM args, int start, int end) { - SCM scm_call_pure_function = ly_lily_module_constant ("call-pure-function"); + if (is_unpure_pure_container (unpure)) + { + SCM pure = unpure_pure_container_pure_part (unpure); + + if (is_simple_closure (pure)) + { + SCM expr = simple_closure_expression (pure); + return evaluate_with_simple_closure (scm_car (args), expr, true, start, end); + } + + if (ly_is_procedure (pure)) + return scm_apply_0 (pure, + scm_append (scm_list_2 (scm_list_3 (scm_car (args), + scm_from_int (start), + scm_from_int (end)), + scm_cdr (args)))); + + return pure; + } + + if (is_simple_closure (unpure)) + { + SCM expr = simple_closure_expression (unpure); + return evaluate_with_simple_closure (scm_car (args), expr, true, start, end); + } + + if (!ly_is_procedure (unpure)) + return unpure; - return scm_apply_0 (scm_call_pure_function, - scm_list_4 (unpure, args, scm_from_int (start), scm_from_int (end))); + return SCM_BOOL_F; }