- /*
- tack onto alist. We can use set_car, since
- updated_grob_properties() in child contexts will check
- for changes in the car.
- */
- if (ok)
- {
- scm_set_car_x (current_context_val, target_alist);
- }
- }
- else
- {
- execute_general_pushpop_property (context,
- context_property,
- scm_cdr (grob_property_path),
- target_alist
- );
- }
+ /* it's tempting to replace the head of the list if it's the same
+ property. However, we have to keep this info around, in case we have to
+ \revert back to it.
+ */
+ target_alist = scm_acons (symbol, new_value, target_alist);
+
+ bool ok = true;
+ if (!ly_is_procedure (new_value)
+ && !is_simple_closure (new_value))
+ ok = type_check_assignment (symbol, new_value,
+ ly_symbol2scm ("backend-type?"));
+
+ /*
+ tack onto alist. We can use set_car, since
+ updated_grob_properties () in child contexts will check
+ for changes in the car.
+ */
+ if (ok)
+ {
+ scm_set_car_x (current_context_val, target_alist);