+
+LY_DEFINE (ly_set_property_cache_callback, "ly:set-property-cache-callback",
+ 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.")
+{
+ cache_callback = (ly_is_procedure (cb)) ? cb : SCM_BOOL_F;
+ return SCM_UNSPECIFIED;
+}
+
+
+void
+Grob::instrumented_set_property (SCM sym, SCM v,
+ char const *file,
+ int line,
+ char const *fun)
+{
+#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));
+#else
+ (void) file;
+ (void) line;
+ (void) fun;