+LY_DEFINE (ly_make_context_mod, "ly:make-context-mod",
+ 0, 1, 0, (SCM mod_list),
+ "Creates a context modification, optionally initialized"
+ " via the list of modifications @var{mod-list}.")
+{
+ if (!SCM_UNBNDP (mod_list))
+ {
+ LY_ASSERT_TYPE (ly_cheap_is_list, mod_list, 1);
+ return Context_mod (mod_list).smobbed_copy ();
+ }
+ else
+ return Context_mod ().smobbed_copy ();
+}
+
+LY_DEFINE (ly_context_mod_apply_x, "ly:context-mod-apply!",
+ 2, 0, 0, (SCM context, SCM mod),
+ "Apply the context modification @var{mod} to @var{context}.")
+{
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_SMOB (Context_mod, mod, 2);
+
+ apply_property_operations (unsmob<Context> (context),
+ unsmob<Context_mod> (mod)->get_mods ());
+ scm_remember_upto_here_1 (context);
+ return SCM_UNSPECIFIED;
+}