+
+MAKE_SCHEME_CALLBACK (Stem, pure_calc_length, 3);
+SCM
+Stem::pure_calc_length (SCM smob, SCM /*start*/, SCM /*end*/)
+{
+ Grob *me = unsmob<Grob> (smob);
+ Real beg = robust_scm2double (me->get_pure_property ("stem-begin-position", 0, INT_MAX), 0.0);
+ Real res = fabs (internal_calc_stem_end_position (me, false) - beg);
+ return scm_from_double (res);
+}
+
+MAKE_SCHEME_CALLBACK (Stem, calc_length, 1);
+SCM
+Stem::calc_length (SCM smob)
+{
+ Grob *me = unsmob<Grob> (smob);
+ if (unsmob<Grob> (me->get_object ("beam")))
+ {
+ me->programming_error ("ly:stem::calc-length called but will not be used for beamed stem.");
+ return scm_from_double (0.0);
+ }
+
+ Real beg = robust_scm2double (me->get_property ("stem-begin-position"), 0.0);
+ Real res = fabs (internal_calc_stem_end_position (me, true) - beg);
+ return scm_from_double (res);
+}
+