- 1, 0, 0, (SCM cb),
- "Specify a procedure that will be called every time LilyPond"
- " modifies a grob property. The callback will receive as"
- " arguments the grob that is being modified, the name of the"
- " C++ file in which the modification was requested, the line"
- " number in the C++ file in which the modification was requested,"
- " the name of the function in which the modification was"
- " requested, the property to be changed, and the new value for"
- " the property.")
+ 1, 0, 0, (SCM cb),
+ "Specify a procedure that will be called every time LilyPond"
+ " modifies a grob property. The callback will receive as"
+ " arguments the grob that is being modified, the name of the"
+ " C++ file in which the modification was requested, the line"
+ " number in the C++ file in which the modification was requested,"
+ " the name of the function in which the modification was"
+ " requested, the property to be changed, and the new value for"
+ " the property.")
- 1, 0, 0, (SCM cb),
- "Specify a procedure that will be called whenever lilypond"
- " calculates a callback function and caches the result. The"
- " callback will receive as arguments the grob whose property it"
- " is, the name of the property, the name of the callback that"
- " calculated the property, and the new (cached) value of the"
- " property.")
+ 1, 0, 0, (SCM cb),
+ "Specify a procedure that will be called whenever lilypond"
+ " calculates a callback function and caches the result. The"
+ " callback will receive as arguments the grob whose property it"
+ " is, the name of the property, the name of the callback that"
+ " calculated the property, and the new (cached) value of the"
+ " property.")
{
#ifndef NDEBUG
if (ly_is_procedure (modification_callback))
scm_apply_0 (modification_callback,
{
#ifndef NDEBUG
if (ly_is_procedure (modification_callback))
scm_apply_0 (modification_callback,
- scm_list_n (self_scm (),
- scm_from_locale_string (file),
- scm_from_int (line),
- scm_from_locale_string (fun),
- sym, v, SCM_UNDEFINED));
+ scm_list_n (self_scm (),
+ scm_from_locale_string (file),
+ scm_from_int (line),
+ scm_from_locale_string (fun),
+ sym, v, SCM_UNDEFINED));
Grob::get_property_alist_chain (SCM def) const
{
return scm_list_n (mutable_property_alist_,
Grob::get_property_alist_chain (SCM def) const
{
return scm_list_n (mutable_property_alist_,
Grob::internal_set_property (SCM sym, SCM v)
{
internal_set_value_on_alist (&mutable_property_alist_,
Grob::internal_set_property (SCM sym, SCM v)
{
internal_set_value_on_alist (&mutable_property_alist_,
- && !is_simple_closure (v)
- && v != ly_symbol2scm ("calculation-in-progress"))
- type_check_assignment (sym, v, ly_symbol2scm ("backend-type?"));
+ && !is_simple_closure (v)
+ && !is_unpure_pure_container (v)
+ && v != ly_symbol2scm ("calculation-in-progress"))
+ type_check_assignment (sym, v, ly_symbol2scm ("backend-type?"));
if (profile_property_accesses)
note_property_access (&grob_property_lookup_table, sym);
#endif
if (profile_property_accesses)
note_property_access (&grob_property_lookup_table, sym);
#endif
SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
if (handle != SCM_BOOL_F)
return scm_cdr (handle);
SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
if (handle != SCM_BOOL_F)
return scm_cdr (handle);
- if (!ly_is_procedure (val) && !is_simple_closure (val))
- type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"));
+ if (!ly_is_procedure (val) && !is_simple_closure (val) && !is_unpure_pure_container (val))
+ type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"));
- programming_error (_f ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
- ly_symbol2string (sym).c_str (),
- name ().c_str ()));
+ programming_error (to_string ("cyclic dependency: calculation-in-progress encountered for #'%s (%s)",
+ ly_symbol2string (sym).c_str (),
+ name ().c_str ()));
Grob::internal_get_pure_property (SCM sym, int start, int end) const
{
SCM val = internal_get_property_data (sym);
Grob::internal_get_pure_property (SCM sym, int start, int end) const
{
SCM val = internal_get_property_data (sym);
return call_pure_function (val, scm_list_1 (self_scm ()), start, end);
if (is_simple_closure (val))
return evaluate_with_simple_closure (self_scm (),
return call_pure_function (val, scm_list_1 (self_scm ()), start, end);
if (is_simple_closure (val))
return evaluate_with_simple_closure (self_scm (),
SCM marker = ly_symbol2scm ("calculation-in-progress");
/*
need to put a value in SYM to ensure that we don't get a
SCM marker = ly_symbol2scm ("calculation-in-progress");
/*
need to put a value in SYM to ensure that we don't get a
else if (is_simple_closure (proc))
{
value = evaluate_with_simple_closure (self_scm (),
else if (is_simple_closure (proc))
{
value = evaluate_with_simple_closure (self_scm (),
/*
If the function returns SCM_UNSPECIFIED, we assume the
property has been set with an explicit set_property ()
/*
If the function returns SCM_UNSPECIFIED, we assume the
property has been set with an explicit set_property ()
- scm_apply_0 (cache_callback,
- scm_list_n (self_scm (),
- sym,
- proc,
- value,
- SCM_UNDEFINED));
+ scm_apply_0 (cache_callback,
+ scm_list_n (self_scm (),
+ sym,
+ proc,
+ value,
+ SCM_UNDEFINED));
note_property_access (&grob_property_lookup_table, sym);
SCM s = scm_sloppy_assq (sym, object_alist_);
note_property_access (&grob_property_lookup_table, sym);
SCM s = scm_sloppy_assq (sym, object_alist_);
- || is_simple_closure (val))
- {
- Grob *me = ((Grob*)this);
- val = me->try_callback_on_alist (&me->object_alist_, sym, val);
- }
-
+ || is_simple_closure (val)
+ || is_unpure_pure_container (val))
+ {
+ Grob *me = ((Grob *)this);
+ val = me->try_callback_on_alist (&me->object_alist_, sym, val);
+ }
+
SCM scm_call_pure_function = ly_lily_module_constant ("call-pure-function");
return scm_apply_0 (scm_call_pure_function,
SCM scm_call_pure_function = ly_lily_module_constant ("call-pure-function");
return scm_apply_0 (scm_call_pure_function,
- scm_list_4 (unpure, args, scm_from_int (start), scm_from_int (end)));
+ scm_list_4 (unpure, args, scm_from_int (start), scm_from_int (end)));