- LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
- LY_ASSERT_TYPE(is_direction, dir,2);
-
- return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
+ LY_ASSERT_SMOB (Spanner, spanner, 1);
+ LY_ASSERT_TYPE (is_direction, dir, 2);
+ Item *bound = unsmob<Spanner> (spanner)->get_bound (to_dir (dir));
+ return bound ? bound->self_scm () : SCM_EOL;
+}
+
+LY_DEFINE (ly_spanner_set_bound_x, "ly:spanner-set-bound!",
+ 3, 0, 0, (SCM spanner, SCM dir, SCM item),
+ "Set grob @var{item} as bound in direction @var{dir} for"
+ " @var{spanner}.")
+{
+ LY_ASSERT_SMOB (Spanner, spanner, 1);
+ LY_ASSERT_TYPE (is_direction, dir, 2);
+ LY_ASSERT_SMOB (Item, item, 3);
+
+ unsmob<Spanner> (spanner)->set_bound (to_dir (dir), unsmob<Item> (item));
+ return SCM_UNSPECIFIED;