]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/lily-guile.hh: is_x -> ly_c_X_p naming.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Apr 2004 14:35:20 +0000 (14:35 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Apr 2004 14:35:20 +0000 (14:35 +0000)
* lily/include/context.hh (class Context): make members protected.
(children_contexts): new accessor function.

* lily/include/context.hh (class Context): make daddy_context_
private.

* lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go
higher for finding Voice. (backportme)

* lily/include/context.hh (class Context): remove
find_context_below() as a method.

65 files changed:
lily/accidental-engraver.cc
lily/align-interface.cc
lily/ambitus.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam-quanting.cc
lily/beam.cc
lily/chord-name-engraver.cc
lily/clef-engraver.cc
lily/cluster-engraver.cc
lily/completion-note-heads-engraver.cc
lily/context.cc
lily/custos-engraver.cc
lily/dots.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/engraver-group-engraver.cc
lily/engraver.cc
lily/event.cc
lily/fingering-engraver.cc
lily/font-metric.cc
lily/font-size-engraver.cc
lily/gourlay-breaking.cc
lily/grob-scheme.cc
lily/include/context.hh
lily/include/lily-guile.hh
lily/key-signature-interface.cc
lily/lily-guile.cc
lily/line-interface.cc
lily/lookup.cc
lily/mark-engraver.cc
lily/multi-measure-rest-engraver.cc
lily/multi-measure-rest.cc
lily/note-collision.cc
lily/note-column.cc
lily/note-head.cc
lily/note-heads-engraver.cc
lily/paper-book.cc
lily/parser.yy
lily/performer-group-performer.cc
lily/pitch-squash-engraver.cc
lily/rest-engraver.cc
lily/rest.cc
lily/rhythmic-head.cc
lily/score-context.cc
lily/score-engraver.cc
lily/script-column.cc
lily/self-aligment-interface.cc
lily/side-position-interface.cc
lily/simple-spacer.cc
lily/slur.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/system.cc
lily/tab-note-heads-engraver.cc
lily/text-engraver.cc
lily/timing-translator.cc
lily/translator-group.cc
lily/tuplet-bracket.cc
lily/virtual-font-metric.cc

index ef374b50140e6740d185e8876cc40bc4a1955525..73314fb4eac282ab23749a71894b426a525f1540 100644 (file)
@@ -135,16 +135,16 @@ number_accidentals_from_sig (bool *different,
   
   /* If an accidental was not found or the accidental was too old */
   if (prev == SCM_BOOL_F ||
-      (is_number (lazyness) && curbarnum_i > accbarnum_i + ly_scm2int (lazyness)))
+      (ly_c_number_p (lazyness) && curbarnum_i > accbarnum_i + ly_scm2int (lazyness)))
     prev = scm_assoc (scm_int2num (n), sig);
 
 
   SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);
 
-  int p = is_number (prev_acc) ? ly_scm2int (prev_acc) : 0;
+  int p = ly_c_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0;
 
   int num;
-  if (a == p && is_number (prev_acc))
+  if (a == p && ly_c_number_p (prev_acc))
     num = 0;
   else if ( (abs (a)<abs (p) || p*a<0) && a != 0 )
     num = 2;
@@ -223,7 +223,7 @@ Accidental_engraver::get_bar_num ()
       
   Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
   if (mp.main_part_ < Rational (0)
-      && is_number (barnum))
+      && ly_c_number_p (barnum))
     barnum = scm_int2num (ly_scm2int (barnum) - 1);
       
   return barnum ;
index 1fe7d172ba7beddd0826438ae0ea122f3053db05..3928ae8f6eb13cdd9184c1a5e27fa3b11bbdd0fe 100644 (file)
@@ -52,7 +52,7 @@ Align_interface::align_to_fixed_distance (Grob *me , Axis a)
   
   SCM d =   me->get_property ("stacking-dir");
   
-  Direction stacking_dir = is_number (d) ? to_dir (d) : CENTER;
+  Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
 
@@ -124,7 +124,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
   
   SCM d =   me->get_property ("stacking-dir");
   
-  Direction stacking_dir = is_number (d) ? to_dir (d) : CENTER;
+  Direction stacking_dir = ly_c_number_p (d) ? to_dir (d) : CENTER;
   if (!stacking_dir)
     stacking_dir = DOWN;
   
@@ -216,7 +216,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
        FIXME: uncommenting freaks out the Y-alignment of
        line-of-score.
        */
-      if (is_number (align))
+      if (ly_c_number_p (align))
        center_offset = total.linear_combination (ly_scm2double (align));
 
       for (int j = 0 ;  j < all_grobs.size (); j++)
@@ -253,7 +253,7 @@ find_fixed_alignment_parent  (Grob *g)
 {
   while (g)
     {
-      if (is_number (g->get_property ("forced-distance")))
+      if (ly_c_number_p (g->get_property ("forced-distance")))
        return g;
 
       g = g->get_parent (Y_AXIS);
index 30c1a9f281f1a69705b6771d1596daed6833e302..eb586b3a8fbc8c3708c74620c83362250fc0b224 100644 (file)
@@ -100,7 +100,7 @@ number_accidentals (SCM key_signature, Pitch *pitch,
     prev = scm_assoc (scm_int2num (notename), key_signature);
 
   SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);
-  int sig_alteration = is_number (prev_acc) ? ly_scm2int (prev_acc) : 0;
+  int sig_alteration = ly_c_number_p (prev_acc) ? ly_scm2int (prev_acc) : 0;
 
   if (alteration == sig_alteration) // no accidental at all needed
     return 0;
@@ -195,7 +195,7 @@ Ambitus::print (SCM smob)
     }
 
   SCM c0 = me->get_property ("c0-position");
-  if (is_number (c0))
+  if (ly_c_number_p (c0))
     {
       p_min += ly_scm2int (c0);
       p_max += ly_scm2int (c0);
index 6f51478f337f57c6210b839d9d5ac7ec550c1d50..716c776d7279b396d9d89bd36f6f391ddee90adb 100644 (file)
@@ -186,7 +186,7 @@ Bar_line::get_staff_bar_size (SCM smob)
   Grob*me = unsmob_grob (smob);
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM size = me->get_property ("bar-size");
-  if (is_number (size))
+  if (ly_c_number_p (size))
     return scm_make_real (ly_scm2double (size)*ss);
   else if (Staff_symbol_referencer::get_staff_symbol (me))
     {
index 931ca71890b72588642e867bd2ad9a28c7a53682..47884280861e0871115f73cf7f2e30f3de8da6d9 100644 (file)
@@ -54,7 +54,7 @@ Bar_number_engraver::process_music ()
        {
          SCM bn = get_property ("currentBarNumber");
          SCM proc = get_property ("barNumberVisibility");
-         if (is_number (bn) && ly_c_procedure_p (proc)
+         if (ly_c_number_p (bn) && ly_c_procedure_p (proc)
              && to_boolean (scm_call_1(proc, bn)))
            {
              create_items ();
index 3a7503bcaa015b71f643242433b3225d9417dfac..3a6f5e9aaf168022438685c38b4cada96a29805a 100644 (file)
@@ -110,7 +110,7 @@ Beam::quanting (SCM smob)
   Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
 
   SCM sdy = me->get_property ("least-squares-dy");
-  Real dy_mus = is_number (sdy) ? ly_scm2double (sdy) : 0.0;
+  Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
   
   Real straddle = 0.0;
   Real sit = (thickness - slt) / 2;
index 6909c464fb0fc135e76be860950e5cbbed7e302d..0ef6741faccea779d1cebb0e95bd8345d2aeb7c6 100644 (file)
@@ -421,7 +421,7 @@ Beam::print (SCM grob)
       Stencil gapped;
 
       int gap_count = 0;
-      if (is_number (me->get_property ("gap-count")))
+      if (ly_c_number_p (me->get_property ("gap-count")))
        {
          gap_count = ly_scm2int (me->get_property ("gap-count"));
          gapped = Lookup::beam (dydx, w - 2 * gap_length, thick, blot);
@@ -570,7 +570,7 @@ Beam::get_default_dir (Grob *me)
                    scm_cons (scm_int2num (total[UP]),
                             scm_int2num (total[DOWN])));
 
-  if (is_number (s) && ly_scm2int (s))
+  if (ly_c_number_p (s) && ly_scm2int (s))
     return to_dir (s);
   
   /* If dir is not determined: get default */
@@ -666,7 +666,7 @@ void
 Beam::consider_auto_knees (Grob* me)
 {
   SCM scm = me->get_property ("auto-knee-gap");
-  if (!is_number (scm))
+  if (!ly_c_number_p (scm))
     return ;
 
   Real threshold = ly_scm2double (scm);
@@ -1101,7 +1101,7 @@ Beam::check_concave (SCM smob)
   */
   bool is_concave1 = false;
   SCM gap = me->get_property ("concaveness-gap");
-  if (is_number (gap))
+  if (ly_c_number_p (gap))
     {
       Real r1 = ly_scm2double (gap);
       Real dy = Stem::chord_start_y (stems.top ())
@@ -1138,7 +1138,7 @@ Beam::check_concave (SCM smob)
   Real concaveness2 = 0;
   SCM thresh = me->get_property ("concaveness-threshold");
   Real r2 = infinity_f;
-  if (!is_concave1 && is_number (thresh))
+  if (!is_concave1 && ly_c_number_p (thresh))
     {
       r2 = ly_scm2double (thresh);
       
@@ -1297,7 +1297,7 @@ Beam::set_stem_lengths (Grob *me)
 
   bool gap = false;
   Real thick =0.0;
-  if (is_number (me->get_property ("gap-count"))
+  if (ly_c_number_p (me->get_property ("gap-count"))
       &&ly_scm2int (me->get_property ("gap-count")))
     {
       gap = true;
@@ -1455,7 +1455,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Grob *rest = unsmob_grob (element_smob);
   Axis a = (Axis) ly_scm2int (axis);
 
-  if (is_number (rest->get_property ("staff-position")))
+  if (ly_c_number_p (rest->get_property ("staff-position")))
     return scm_int2num (0);
   
   assert (a == Y_AXIS);
@@ -1472,7 +1472,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
 
   Drul_array<Real> pos (0, 0);
   SCM s = beam->get_property ("positions");
-  if (ly_c_pair_p (s) && is_number (ly_car (s)))
+  if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s)))
     pos = ly_scm2interval (s);
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
index c8ba1d2bebb98a22c8db25a4b9b6632563ece822..152ca2fdb21c812a15c3536295bc7f8139931a2a 100644 (file)
@@ -86,7 +86,7 @@ Chord_name_engraver::process_music ()
   if (inversion_event)
     {
       SCM oct = inversion_event->get_property ("octavation");
-      if (is_number (oct))
+      if (ly_c_number_p (oct))
        {
          Pitch *p = unsmob_pitch (inversion_event->get_property ("pitch"));
          int octavation =  ly_scm2int (oct);
index 361ce607fc44fea1a0eeddf73f7534b7fbeb9232..670dd39b4df21e5618921e0df9db18e969fc05ed 100644 (file)
@@ -92,11 +92,11 @@ Clef_engraver::create_clef ()
       clef_ = c;
       SCM cpos = get_property ("clefPosition");
 
-      if (is_number (cpos))
+      if (ly_c_number_p (cpos))
        Staff_symbol_referencer::set_position (clef_, ly_scm2int (cpos));
 
       SCM oct =  get_property ("clefOctavation");
-      if (is_number (oct) && ly_scm2int (oct))
+      if (ly_c_number_p (oct) && ly_scm2int (oct))
        {
          Item * g = make_item ("OctavateEight");
 
index 52f14cdfba457ac90fcfc9f4fb0ae9ab4ff8b018..391d3fbd133e408dd1df864bd78236897448eeed 100644 (file)
@@ -82,7 +82,7 @@ Cluster_spanner_engraver::process_music ()
     {
       SCM c0scm = get_property ("middleCPosition");
 
-      int c0 =  is_number (c0scm) ? ly_scm2int (c0scm) : 0;
+      int c0 =  ly_c_number_p (c0scm) ? ly_scm2int (c0scm) : 0;
       int pmax = INT_MIN;
       int pmin = INT_MAX;
       
index 16b9e613750ea60e690874613c29ae929deb07a0..4c52d88ae454560a16f5af6b6b3eee2489f1c5f6 100644 (file)
@@ -245,7 +245,7 @@ Completion_heads_engraver::process_music ()
 
       int pos = pit->steps ();
       SCM c0 = get_property ("middleCPosition");
-      if (is_number (c0))
+      if (ly_c_number_p (c0))
        pos += ly_scm2int (c0);
 
       note->set_property ("staff-position",   scm_int2num (pos));
index fc7a17ff1f4636c3a30178d69e8a8e8ea3c9cc92..fedc490c8348cf998aec68cecf7b550e968f2bd4 100644 (file)
@@ -412,7 +412,7 @@ IMPLEMENT_TYPE_P (Context,"ly:context?");
 bool
 Context::try_music (Music* m)
 {
-  Translator*  t = unsmob_translator (implementation_);
+  Translator*  t = implementation ();
   if (!t)
     return false;
   
@@ -442,3 +442,9 @@ Context::get_parent_context () const
 {
   return daddy_context_;
 }
+
+Translator_group*
+Context::implementation () const
+{
+  return dynamic_cast<Translator_group*> (unsmob_translator (implementation_));
+}
index 5b110886c347b13fa86b2e7eafc1d16853934e41..86dac5847e2eeae9e4ea62a1bd72ec4b4c45b6fa 100644 (file)
@@ -108,7 +108,7 @@ Custos_engraver::process_acknowledged_grobs ()
 
          int p = pitches_[i].steps ();
          SCM c0 = get_property ("middleCPosition");
-         if (is_number (c0))
+         if (ly_c_number_p (c0))
            p += ly_scm2int (c0);
 
          
index d4ccf97b59c93a3cd98c7d3601842f0684fdcfd3..d324027a1ab123573fe55d6d11777fda721ba388 100644 (file)
@@ -24,7 +24,7 @@ Dots::print (SCM d)
   
   SCM c = sc->get_property ("dot-count");
 
-  if (is_number (c))
+  if (ly_c_number_p (c))
     {
       Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot"));
       Real dw = d.extent (X_AXIS).length ();
index b1e2d7e7466a02157393f0ab142e34ffb2e7c840..3740b09f9a63149962110f66d5e9c5959489714d 100644 (file)
@@ -172,7 +172,7 @@ LY_DEFINE (make_duration, "ly:make-duration",
   bool compress = false;
   if (num != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (num), length, SCM_ARG3, __FUNCTION__, "integer");
+      SCM_ASSERT_TYPE (ly_c_number_p (num), length, SCM_ARG3, __FUNCTION__, "integer");
       compress = true;
     }
   else
@@ -180,7 +180,7 @@ LY_DEFINE (make_duration, "ly:make-duration",
 
   if (den != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (den), length, SCM_ARG4, __FUNCTION__, "integer");
+      SCM_ASSERT_TYPE (ly_c_number_p (den), length, SCM_ARG4, __FUNCTION__, "integer");
       compress = true;
     }
   else
@@ -214,7 +214,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
          "The 2-logarithm of 1/@var{d}.")
 {
-  SCM_ASSERT_TYPE (is_number (d), d, SCM_ARG1, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG1, __FUNCTION__, "integer");
   int log = intlog2 (ly_scm2int (d));
   return scm_int2num (log);
 }
index c58de021c1b5a964c638d9c5bc25fd8d41960429..3c7dc854e490fa6b7852c1a540e7995f7724439b 100644 (file)
@@ -414,7 +414,7 @@ Dynamic_engraver::acknowledge_grob (Grob_info i)
 
        DynamicText doesn't really have a script-priority field.
        */
-      if (is_number (p)
+      if (ly_c_number_p (p)
          && ly_scm2int (p) < ly_scm2int (script_->get_property ("script-priority")))
        {
          Side_position_interface::add_support (line_spanner_, i.grob_);
index 53e8a5e0d4392475d8a26eb9c49b0a4dbe4da1d7..257708de292fabf63f9b4b7b9eb8a16a5f1b56fb 100644 (file)
@@ -59,12 +59,12 @@ Dynamic_performer::create_audio_elements ()
        */
       SCM min = get_property ("midiMinimumVolume");
       SCM max = get_property ("midiMaximumVolume");
-      if (is_number (min) || is_number (max))
+      if (ly_c_number_p (min) || ly_c_number_p (max))
        {
          Interval iv (0, 1);
-         if (is_number (min))
+         if (ly_c_number_p (min))
            iv[MIN] = ly_scm2double (min);
-         if (is_number (max))
+         if (ly_c_number_p (max))
            iv[MAX] = ly_scm2double (max);
          volume = iv[MIN] + iv.length () * volume;
        }
index 9b33ad9398dafaddafc832afaa727cbbd1e8d66c..8a2d6da2145d005bb5f1cac27d802484ee76c7c5 100644 (file)
@@ -157,7 +157,7 @@ void
 recurse_down_engravers (Context * c, Engraver_method ptr, bool context_first)
 {
   Engraver_group_engraver * tg
-    = dynamic_cast<Engraver_group_engraver*> (unsmob_translator (c->implementation_));
+    = dynamic_cast<Engraver_group_engraver*> (c->implementation ());
 
 
   if (!context_first)
index 4119670e7a7948b6045fa79600cbf9228b499508..fa2e68479a838715a064c40f06edb31878b51e49 100644 (file)
@@ -61,7 +61,6 @@ Engraver::typeset_grob (Grob*p)
 }
 
 
-
 Engraver::Engraver ()
 {
 }
@@ -70,8 +69,7 @@ Engraver::Engraver ()
 Score_engraver* 
 Engraver::get_score_engraver () const
 {
-  SCM t = get_score_context ()->implementation_;
-  return dynamic_cast<Score_engraver*> (unsmob_translator (t));
+  return dynamic_cast<Score_engraver*> (get_score_context ()->implementation ());
 }
 
 
index c52a0701afe747daed22b6a9620759b9c50656e8..1c1112379bf68a5dd2a8fd478fe6965351e85997 100644 (file)
@@ -63,7 +63,7 @@ Event::to_relative_octave (Pitch last)
       new_pit = new_pit.to_relative_octave (last);
 
       SCM check = get_property ("absolute-octave");
-      if (is_number (check) &&
+      if (ly_c_number_p (check) &&
          new_pit.get_octave () != ly_scm2int (check))
        {
          Pitch expected_pit (ly_scm2int (check),
@@ -160,7 +160,7 @@ LY_DEFINE (ly_transpose_key_alist, "ly:transpose-key-alist",
          newlist = scm_cons (scm_cons (key, scm_int2num (orig.get_alteration ())),
                             newlist);
        }
-      else if (is_number (key))
+      else if (ly_c_number_p (key))
        {
          Pitch orig (0, ly_scm2int (key), ly_scm2int (alter));
          orig = orig.transposed (*p);
index 3b4b9dc6fb86aca51994d9389a65050eba2f6e1a..a281bbdf77c94afcbc3728875c9a3a0157e95421 100644 (file)
@@ -105,7 +105,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i)
   // Hmm
   int priority = 200;
   SCM s = fingering->get_property ("script-priority");
-  if (is_number (s))
+  if (ly_c_number_p (s))
     priority = ly_scm2int (s);
   
   /* See script-engraver.cc */
index 6e07465592b028c0f9fe7eea374bc442ee1eee78..49462f8789db9e05b14305b0c5997d8ae19534bd 100644 (file)
@@ -155,7 +155,7 @@ LY_DEFINE (ly_get_glyph, "ly:get-glyph",
 {
   Font_metric *fm = unsmob_metrics (font);
   SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
-  SCM_ASSERT_TYPE (is_number (index), index, SCM_ARG2, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (ly_c_number_p (index), index, SCM_ARG2, __FUNCTION__, "number");
 
   return fm->get_ascii_char_stencil (ly_scm2int (index)).smobbed_copy ();
 }
index 96846d0d181fa9597156a4d01c9ab1079a74b81d..9e68c27676a924ca575d4b6d44734720fb818674 100644 (file)
@@ -36,7 +36,7 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
   if (gi.origin_trans_->get_parent_context () != get_parent_context ())
     return ;
   
-  if (is_number (sz) && ly_scm2double (sz))
+  if (ly_c_number_p (sz) && ly_scm2double (sz))
     {
       Real font_size = ly_scm2double (sz);
       
index c40047173944a8e47bad490901eed8b2e68a41a7..7657efec136b4bcdcb073ae53707e9baa525f52e 100644 (file)
@@ -233,7 +233,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
   if (pc->original_)
     {
       SCM pen = pc->get_property ("penalty");
-      if (is_number (pen) && fabs (ly_scm2double (pen)) < 10000)
+      if (ly_c_number_p (pen) && fabs (ly_scm2double (pen)) < 10000)
        {
          break_penalties += ly_scm2double (pen);
        }
index 80d468abe68a37d16923d722bc9fce8e56353f60..1557d3105bc0a0499d2554fa601cfa680e3091dc 100644 (file)
@@ -169,7 +169,7 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
 {
   Grob *me = unsmob_grob (g);
   SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
-  SCM_ASSERT_TYPE (is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension");
+  SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
   SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
 
   me->translate_axis (ly_scm2double (d), Axis (ly_scm2int (a)));
index 55a4671eaa5d9a269ec39e954f5cafdd89acc09e..75c7e65ac6f36d919741194a575187d8d2207378 100644 (file)
@@ -22,6 +22,11 @@ class Context
 
   void terminate ();
 
+private:
+  friend class Interpretation_context_handle;
+  int iterator_count_;
+  bool init_;
+  
 protected:
   Context * daddy_context_;
   SCM definition_;
@@ -29,12 +34,14 @@ protected:
   SCM context_list_;
   SCM accepts_list_;
   SCM aliases_;
+  SCM implementation_;
 
   friend class Context_def;
 public:
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
-
+  Translator_group* implementation () const;
+  
   Context * get_parent_context () const;
   
   Context ();
@@ -68,12 +75,6 @@ public:
                                                  Music_output_def*) const;
   virtual Context *get_default_interpreter ();
   String id_string_;
-
-  SCM implementation_;
-private:
-  friend class Interpretation_context_handle;
-  int iterator_count_;
-  bool init_;
 };
 
 /*
index f9b1b2072c371a7b4c9ff68ce1018f44111d7f0d..cf0a60f69150f1bb370ff148bfa6117b18221f3d 100644 (file)
@@ -191,10 +191,10 @@ inline SCM ly_assoc_front_x(SCM alist, SCM key, SCM val)
   return scm_acons(key, val, scm_assoc_remove_x (alist, key));
 }
 inline bool ly_c_pair_p (SCM x) { return SCM_NFALSEP (scm_pair_p (x)); }
-inline bool ly_c_symbol_pi (SCM x) { return SCM_SYMBOLP (x); }
+inline bool ly_c_symbol_p (SCM x) { return SCM_SYMBOLP (x); }
 inline bool ly_c_boolean_p (SCM x) { return SCM_BOOLP (x); }
 inline bool ly_c_char_p (SCM x) { return SCM_CHARP (x); }
-inline bool is_number (SCM x) { return SCM_NUMBERP (x); }
+inline bool ly_c_number_p (SCM x) { return SCM_NUMBERP (x); }
 inline bool ly_c_string_p (SCM x) { return SCM_STRINGP (x); }
 inline bool ly_c_vector_p (SCM x) { return SCM_VECTORP (x); }
 inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
index 0616dcffcb23529114bfb445353dedd168948499..4666d4982a749dcdc6ee7fc537f1b13ebcc9c752 100644 (file)
@@ -118,7 +118,7 @@ Key_signature_interface::print (SCM smob)
 
   SCM c0s = me->get_property ("c0-position");
   int c0p = 0;
-  if (is_number (c0s))
+  if (ly_c_number_p (c0s))
     c0p = ly_scm2int (c0s);
 
   /*
index e821369ac2fe832903161feee7a0dee3855656c4..1c03bf92cb2e7cd33057928e7838036d6ebeae5e 100644 (file)
@@ -187,7 +187,7 @@ LY_DEFINE (ly_dir_p,  "ly:dir?", 1,0, 0,  (SCM s),
           "@code{1}, where @code{-1} represents "
          "left or down and @code{1} represents right or up.")
 {
-  if (is_number (s))
+  if (ly_c_number_p (s))
     {
       int i = ly_scm2int (s);
       return (i>= -1 && i <= 1)  ? SCM_BOOL_T : SCM_BOOL_F; 
@@ -198,7 +198,7 @@ LY_DEFINE (ly_dir_p,  "ly:dir?", 1,0, 0,  (SCM s),
 bool
 is_number_pair (SCM p)
 {
-  return ly_c_pair_p (p) && is_number (ly_car (p)) && is_number (ly_cdr (p));
+  return ly_c_pair_p (p) && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p));
 }
 
 typedef void (*Void_fptr) ();
@@ -244,7 +244,7 @@ unsigned int ly_scm_hash (SCM s)
 bool
 is_direction (SCM s)
 {
-  if (is_number (s))
+  if (ly_c_number_p (s))
     {
       int i = ly_scm2int (s);
       return i>= -1 && i <= 1; 
@@ -256,7 +256,7 @@ is_direction (SCM s)
 bool
 is_axis (SCM s)
 {
-  if (is_number (s))
+  if (ly_c_number_p (s))
     {
       int i = ly_scm2int (s);
       return i== 0 || i == 1;
@@ -334,7 +334,7 @@ LY_DEFINE (ly_number2string, "ly:number->string",
           1, 0, 0, (SCM s),
           "Convert @var{num} to a string without generating many decimals.")
 {
-  SCM_ASSERT_TYPE (is_number (s), s, SCM_ARG1, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (ly_c_number_p (s), s, SCM_ARG1, __FUNCTION__, "number");
 
   char str[400];                       // ugh.
 
@@ -699,7 +699,7 @@ int_list_to_slice (SCM l)
   Slice s;
   s.set_empty ();
   for (; ly_c_pair_p (l); l = ly_cdr (l))
-    if (is_number (ly_car (l)))
+    if (ly_c_number_p (ly_car (l)))
       s.add_point (ly_scm2int (ly_car (l))); 
   return s;
 }
@@ -719,7 +719,7 @@ robust_list_ref (int i, SCM l)
 Real
 robust_scm2double (SCM k, double x)
 {
-  if (is_number (k))
+  if (ly_c_number_p (k))
     x = ly_scm2double (k);
   return x;
 }
index cbcf9b02edb4dae613e5c0e1a87e63c42c3e57c2..317df83495b5e2c434e2b364e04469fce768147f 100644 (file)
@@ -73,7 +73,7 @@ Line_interface::line (Grob *me, Offset from, Offset to)
   SCM type = me->get_property ("style");
 
   SCM dash_fraction = me->get_property ("dash-fraction");
-  if (is_number (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
+  if (ly_c_number_p (dash_fraction) || type == ly_symbol2scm ("dotted-line"))
     {
       
       Real fraction
index 7be702385a3dfb80bf6dd0363cabb6b72946c67c..222d7ebd0f280e19dfbb41c2c7ada30f0685a11e 100644 (file)
@@ -710,8 +710,8 @@ LY_DEFINE (ly_bracket ,"ly:bracket",
 {
   SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG1, __FUNCTION__, "axis") ;
   SCM_ASSERT_TYPE (is_number_pair (iv), iv, SCM_ARG2, __FUNCTION__, "number pair") ;
-  SCM_ASSERT_TYPE (is_number (t), a, SCM_ARG3, __FUNCTION__, "number") ;
-  SCM_ASSERT_TYPE (is_number (p), a, SCM_ARG4, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (ly_c_number_p (t), a, SCM_ARG3, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
 
 
   return Lookup::bracket ((Axis)ly_scm2int (a), ly_scm2interval (iv),
@@ -732,7 +732,7 @@ LY_DEFINE (ly_filled_box ,"ly:round-filled-box",
 {
   SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
   SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
-  SCM_ASSERT_TYPE (is_number (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+  SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
 
   return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
                                   ly_scm2double (blot)).smobbed_copy ();
index 18733b052704131d222173623231dcb8b94c48ed..a7e050d92ca093ed97e1afd2b03523fbb2031900 100644 (file)
@@ -115,7 +115,7 @@ Mark_engraver::process_music ()
       if (!Text_item::markup_p (m) &&
          ly_c_procedure_p (proc))
        {
-         if (!is_number (m)) 
+         if (!ly_c_number_p (m)) 
            m =  get_property ("rehearsalMark");
 
          if (scm_integer_p (m) == SCM_BOOL_T
@@ -127,7 +127,7 @@ Mark_engraver::process_music ()
                                            scm_int2num (mark_count));
            }
 
-         if (is_number (m))
+         if (ly_c_number_p (m))
            m = scm_call_2 (proc, m, get_parent_context ()->self_scm ());
          else
            warning ("rehearsalMark does not have integer value.");
index d33828dc1f220b2bddff8f734835687db3c2f28b..3971353441676daed87b36db818d91564aa95018 100644 (file)
@@ -263,7 +263,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
        {
          SCM thres = get_property ("restNumberThreshold");
          int t = 1;
-         if (is_number (thres))
+         if (ly_c_number_p (thres))
            t = ly_scm2int (thres);
       
          if (num <= t)
index 81a5d4013a8610a99876526ce6cd76e65c8d9dcb..61bbf1f84d8991f5ba86b7abe0c5c5a983aa7aa8 100644 (file)
@@ -102,7 +102,7 @@ Multi_measure_rest::print (SCM smob)
 
   int measures = 0;
   SCM m (me->get_property ("measure-count"));
-  if (is_number (m))
+  if (ly_c_number_p (m))
     {
       measures = ly_scm2int (m);
     }
@@ -118,7 +118,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
 {
   int measures = 0;
   SCM m (me->get_property ("measure-count"));
-  if (is_number (m))
+  if (ly_c_number_p (m))
     {
       measures = ly_scm2int (m);
     }
index a72e72cd90b1a3aaa6d0372aa445af4ba91a1a0b..2d7c595cf1b9caeb1de6d9c71b64bd22731e0250 100644 (file)
@@ -371,7 +371,7 @@ Note_collision_interface::automatic_shift (Grob *me,
          SCM sh
            = clashes[i]->get_property ("horizontal-shift");
 
-         if (is_number (sh))
+         if (ly_c_number_p (sh))
            shift.push (ly_scm2int (sh));
          else
            shift.push (0);
@@ -457,7 +457,7 @@ Note_collision_interface::forced_shift (Grob *me)
       Grob * se = unsmob_grob (ly_car (s));
 
       SCM force =  se->get_property ("force-hshift");
-      if (is_number (force))
+      if (ly_c_number_p (force))
        {
          tups = scm_cons (scm_cons (se->self_scm (), force),
                          tups);
index bc09959fc0707553b4ebb68d20826064cccc19ff..2edd77425740ca3148aa9a7e871ede12d324e781 100644 (file)
@@ -35,8 +35,8 @@ Note_column::shift_compare (Grob *const &p1, Grob *const&p2)
   SCM s1 = p1->get_property ("horizontal-shift");
   SCM s2 = p2->get_property ("horizontal-shift");
 
-  int h1 = (is_number (s1))?  ly_scm2int (s1) :0;
-  int h2 = (is_number (s2)) ? ly_scm2int (s2):0;
+  int h1 = (ly_c_number_p (s1))?  ly_scm2int (s1) :0;
+  int h2 = (ly_c_number_p (s2)) ? ly_scm2int (s2):0;
   return h1 - h2;
 }
 
@@ -126,7 +126,7 @@ void
 Note_column::translate_rests (Grob*me, int dy)
 {
   Grob * r = unsmob_grob (me->get_property ("rest"));
-  if (r && !is_number (r->get_property ("staff-position")))
+  if (r && !ly_c_number_p (r->get_property ("staff-position")))
     {
       r->translate_axis (dy * Staff_symbol_referencer::staff_space (r)/2.0, Y_AXIS);
     }
index a7accb9c75fb94b18cac7ac0a720bfe66e8f1bb1..15841c801c0f86c4161ce807f437ae65ac135413 100644 (file)
@@ -333,7 +333,7 @@ int
 Note_head::get_balltype (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return is_number (s) ? ly_scm2int (s) <? 2 : 0;
+  return ly_c_number_p (s) ? ly_scm2int (s) <? 2 : 0;
 }
 
 ADD_INTERFACE (Note_head,"note-head-interface",
index 975e462add06b8d3a175a2ac11c18fd0de290c51..8fb85cd94a23f576027a34e3404664f8eb87f53c 100644 (file)
@@ -82,7 +82,7 @@ Note_heads_engraver::process_music ()
 
       int pos = pit ? pit->steps () : 0;
       SCM c0 = get_property ("middleCPosition");
-      if (is_number (c0))
+      if (ly_c_number_p (c0))
        pos += ly_scm2int (c0);
 
       note->set_property ("staff-position",   scm_int2num (pos));
index 80ce79fb70d14c667d0b4b691df43efff733aa73..5b5f9dba4a56658d93ea99a0bcde21fda30c3edb 100644 (file)
@@ -489,10 +489,10 @@ LY_DEFINE (ly_ragged_page_breaks, "ly:ragged-page-breaks",
           "Return a vector with line numbers of page breaks.")
 {
   SCM_ASSERT_TYPE (scm_pair_p (lines), lines, SCM_ARG1, __FUNCTION__, "list");
-  SCM_ASSERT_TYPE (is_number (book), book, SCM_ARG2, __FUNCTION__, "real");
-  SCM_ASSERT_TYPE (is_number (text), text, SCM_ARG2, __FUNCTION__, "real");
-  SCM_ASSERT_TYPE (is_number (first), first, SCM_ARG2, __FUNCTION__, "real");
-  SCM_ASSERT_TYPE (is_number (last), last, SCM_ARG2, __FUNCTION__, "real");
+  SCM_ASSERT_TYPE (ly_c_number_p (book), book, SCM_ARG2, __FUNCTION__, "real");
+  SCM_ASSERT_TYPE (ly_c_number_p (text), text, SCM_ARG2, __FUNCTION__, "real");
+  SCM_ASSERT_TYPE (ly_c_number_p (first), first, SCM_ARG2, __FUNCTION__, "real");
+  SCM_ASSERT_TYPE (ly_c_number_p (last), last, SCM_ARG2, __FUNCTION__, "real");
 
   return c_ragged_page_breaks (lines,
                               ly_scm2double (book), ly_scm2double (text),
index f2089487d6899da42df38d95c2f75417e24a6298..fa453ad70db7130f9047479bd936cbaaee9468b0 100644 (file)
@@ -1959,7 +1959,7 @@ bass_figure:
                Music *m = unsmob_music ($1);
                if ($2) {
                        SCM salter = m->get_property ("alteration");
-                       int alter = is_number (salter) ? ly_scm2int (salter) : 0;
+                       int alter = ly_c_number_p (salter) ? ly_scm2int (salter) : 0;
                        m->set_property ("alteration",
                                scm_int2num (alter + $2));
                } else {
@@ -2022,7 +2022,7 @@ simple_element:
                n->set_property ("pitch", $1);
                n->set_property ("duration", $5);
 
-               if (is_number ($4))
+               if (ly_c_number_p ($4))
                {
                        int q = ly_scm2int ($4);
                        n->set_property ("absolute-octave", scm_int2num (q-1));
@@ -2431,7 +2431,7 @@ My_lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
        if (ly_c_string_p (sid)) {
                *destination = sid;
                return STRING_IDENTIFIER;
-       } else if (is_number (sid)) {
+       } else if (ly_c_number_p (sid)) {
                *destination = sid;
                return NUMBER_IDENTIFIER;
        } else if (unsmob_context_def (sid)) {
index 0a6011df88b26bdf182df24b35daaf77a700192f..7319dd92233f097383bbd45f361bc00782db7854 100644 (file)
@@ -28,7 +28,7 @@ Performer_group_performer::announce_element (Audio_element_info info)
 {
   announce_infos_.push (info);
   Translator *t
-    = unsmob_translator (get_parent_context ()->get_parent_context ()->implementation_);
+    = get_parent_context ()->get_parent_context ()->implementation ();
 
   if (Performer_group_performer * eg = dynamic_cast<Performer_group_performer*> (t))
     eg->announce_element (info);
index d8a4a828de6ce426b6fdf69e9e1975517abc2084..3acff5c995f39144c26e5590d6c38855580af403 100644 (file)
@@ -22,7 +22,7 @@ void
 Pitch_squash_engraver::acknowledge_grob (Grob_info i)
 {
   SCM newpos = get_property ("squashedPosition");
-  if (is_number (newpos)
+  if (ly_c_number_p (newpos)
       && Note_head::has_interface (i.grob_))
     {
       i.grob_->set_property ("staff-position", newpos);
index a7a993e5c91584d09ab7419099b287651ceb9b64..6426973f8ccc2f1529b41ad4d7c889e4c366b5ea 100644 (file)
@@ -94,7 +94,7 @@ Rest_engraver::process_music ()
        {
          int pos= p->steps ();
          SCM c0 = get_property ("middleCPosition");
-         if (is_number (c0))
+         if (ly_c_number_p (c0))
            pos += ly_scm2int (c0);
          
          rest_->set_property ("staff-position", scm_int2num (pos));
index 18869230370a1e427e5531d60c2bcdf0c26de254..fc1f7e278276d556f809399bc5ea977f6c547fe1 100644 (file)
@@ -120,7 +120,7 @@ Rest::brew_internal_stencil (SCM smob)
   Grob* me = unsmob_grob (smob);
 
   SCM balltype_scm = me->get_property ("duration-log");
-  if (!is_number (balltype_scm))
+  if (!ly_c_number_p (balltype_scm))
     return Stencil ().smobbed_copy ();
 
   int balltype = ly_scm2int (balltype_scm);
@@ -161,7 +161,7 @@ SCM
 Rest::polyphonic_offset_callback (SCM smob, SCM)
 {
   Grob* me = unsmob_grob (smob);
-  if (is_number (me->get_property ("staff-position")))
+  if (ly_c_number_p (me->get_property ("staff-position")))
     return scm_make_real (0);
 
   Direction d = get_grob_direction (me);
index ebc03a0870092421ec883cd45badbb5dcfeda15f..b76ee9229d60f4d3669c704b464f16b363f271ce 100644 (file)
@@ -45,7 +45,7 @@ int
 Rhythmic_head::duration_log (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return is_number (s) ? ly_scm2int (s) : 0;
+  return ly_c_number_p (s) ? ly_scm2int (s) : 0;
 }
 
 ADD_INTERFACE (Rhythmic_head,"rhythmic-head-interface",
index acabbe813f20f2275f561320042343a7fc98d6a6..6cbd6a555915c9263a8f4ee6d20f1aea3adf7213 100644 (file)
@@ -12,7 +12,7 @@
 void
 Score_context::prepare (Moment w)
 {
-  Translator*  t = unsmob_translator (implementation_);
+  Translator*  t = implementation ();
   Score_translator * s = dynamic_cast<Score_translator *> (t);
 
   s->prepare (w);
@@ -21,7 +21,7 @@ Score_context::prepare (Moment w)
 void
 Score_context::finish ()
 {
-  Translator*  t = unsmob_translator (implementation_);
+  Translator*  t = implementation ();
   Score_translator * s = dynamic_cast<Score_translator *> (t);
 
   s->finish ();
@@ -30,7 +30,7 @@ Score_context::finish ()
 void
 Score_context::one_time_step ()
 {
-  Translator*  t = unsmob_translator (implementation_);
+  Translator*  t = implementation ();
   Score_translator * s = dynamic_cast<Score_translator *> (t);
   s->one_time_step ();
 }
@@ -38,7 +38,7 @@ Score_context::one_time_step ()
 Music_output*
 Score_context::get_output ()
 {
-  Translator *t = unsmob_translator (implementation_);
+  Translator *t = implementation ();
   Score_translator *s = dynamic_cast<Score_translator *> (t);
   return s->get_output ();
 }
index 3fc44c527d00b02dd01f69a549bd86bedd92f4bd..e3bd20fb7ca1f26079827411e3998c86d74033a6 100644 (file)
@@ -267,10 +267,10 @@ Score_engraver::try_music (Music *m)
   if (m->is_mus_type ("break-event"))
     {
       SCM pen = command_column_->get_property ("penalty");
-      Real total_penalty = is_number (pen) ? ly_scm2double (pen) : 0.0;
+      Real total_penalty = ly_c_number_p (pen) ? ly_scm2double (pen) : 0.0;
 
       SCM mpen = m->get_property ("penalty");
-      if (is_number (mpen))
+      if (ly_c_number_p (mpen))
        total_penalty += ly_scm2double (mpen);
 
       command_column_->set_property ("penalty", scm_make_real (total_penalty));
@@ -280,9 +280,9 @@ Score_engraver::try_music (Music *m)
        forbid_breaks ();
 
       SCM page_pen = command_column_->get_property ("page-penalty");
-      Real total_pp = is_number (page_pen) ? ly_scm2double (page_pen) : 0.0;
+      Real total_pp = ly_c_number_p (page_pen) ? ly_scm2double (page_pen) : 0.0;
       SCM mpage_pen = m->get_property ("page-penalty");
-      if (is_number (mpage_pen))
+      if (ly_c_number_p (mpage_pen))
        total_pp += ly_scm2double (mpage_pen);
       
       command_column_->set_property ("page-penalty", scm_make_real (total_pp));
index 2f059721abbfacc3d39a0f16d7e310047e68afc1..52e5adcd0dbdbbe07f76b647a369c82987aad796 100644 (file)
@@ -15,7 +15,7 @@ void
 Script_column::add_staff_sided (Grob *me, Item *i)
 {
   SCM p = i->get_property ("script-priority");
-  if (!is_number (p))
+  if (!ly_c_number_p (p))
     return;
 
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"),i);
index 70e2020743a52f90422f8ca720a0c3229ce27980..870d077d6dc7c8b6cf91eb56dd55604a4b39ca40 100644 (file)
@@ -28,7 +28,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
   SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
   SCM align_prop (me->internal_get_property (sym));
 
-  if (!is_number (align_prop))
+  if (!ly_c_number_p (align_prop))
     return scm_int2num (0);
 
   Real x = 0.0;
@@ -86,7 +86,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
   SCM sym= (a == X_AXIS) ? ly_symbol2scm ("self-alignment-X"): ly_symbol2scm ("self-alignment-Y");
   
   SCM align (me->internal_get_property (sym));
-  if (is_number (align))
+  if (ly_c_number_p (align))
     {
       Interval ext (me->extent (me,a));
 
index 82b1ff44ba5a4c12dc87b1fb146e52ff8ec74e66..556381419accbfa8ef51fbc7d60c5b970a12106a 100644 (file)
@@ -73,7 +73,7 @@ Side_position_interface::general_side_position (Grob * me, Axis a, bool use_exte
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   bool include_staff = (st
                        && a == Y_AXIS
-                       && is_number (me->get_property ("staff-padding")));
+                       && ly_c_number_p (me->get_property ("staff-padding")));
 
   Interval dim;
   if (include_staff)
@@ -222,7 +222,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
  */
   Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
   if (st && a == Y_AXIS
-      && is_number (me->get_property ("staff-padding")))
+      && ly_c_number_p (me->get_property ("staff-padding")))
     {
       Real padding=
       Staff_symbol_referencer::staff_space (me)
index 3682dc1443ef02ef82bd2f696d1e1b554634bb88..8aab99bc4fa19410f4cd280b988055f8baa81fc2 100644 (file)
@@ -369,7 +369,7 @@ Simple_spacer::solve (Column_x_positions *positions, bool ragged)
   for (int i = sz; i--; )
     {
       SCM p = positions->cols_[i]->get_property ( "penalty");
-      if (is_number (p))
+      if (ly_c_number_p (p))
        {
          if (ly_scm2double (p) < -9999)
            break_satisfy = break_satisfy && (i == 0 || i == sz -1);
index a9454eba90d386f1f5832552a72e7381b94a02f2..3759cc75d50ba8bac67ccd82b1bed4542a8f9eae 100644 (file)
@@ -133,7 +133,7 @@ Slur::check_slope (Grob *me)
     Avoid too steep slurs.
    */
   SCM s = me->get_property ("slope-limit");
-  if (is_number (s))
+  if (ly_c_number_p (s))
     {
       Array<Offset> encompass = get_encompass_offsets (me);
       Drul_array<Offset> attachment;
@@ -565,7 +565,7 @@ Slur::print (SCM smob)
     TODO: replace dashed with generic property.
    */
   SCM d =  me->get_property ("dashed");
-  if (is_number (d))
+  if (ly_c_number_p (d))
     a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0));
   else
     a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
@@ -598,13 +598,13 @@ Slur::set_control_points (Grob*me)
 
       SCM ssb = me->get_property ("beautiful");
       Real sb = 0;
-      if (is_number (ssb))
+      if (ly_c_number_p (ssb))
        sb = ly_scm2double (ssb);
 
       bb.minimise_enclosed_area (sb, details);
       SCM sbf = scm_assq (ly_symbol2scm ("force-blowfit"), details);
       Real bff = 1.0;
-      if (ly_c_pair_p (sbf) && is_number (ly_cdr (sbf)))
+      if (ly_c_pair_p (sbf) && ly_c_number_p (ly_cdr (sbf)))
          bff = ly_scm2double (ly_cdr (sbf));
 
       bb.curve_.control_[1][Y_AXIS] *= bff;
index ecdcc3cd0edcdb03e9b2ab674a092467c228f8b7..354c402f792be242cf8d248b726b7fd359bf8f68 100644 (file)
@@ -108,7 +108,7 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM)
 
   SCM pos = me->get_property ("staff-position");
   Real off = 0.0;
-  if (is_number (pos))
+  if (ly_c_number_p (pos))
     {
       Real space = Staff_symbol_referencer::staff_space (me);
       off = ly_scm2double (pos) * space / 2.0;
index bda21ab5e4073c20a4af81161baba10cfeb0160e..46de29351095ff9f5bfd78be9b1d43d277838763 100644 (file)
@@ -42,7 +42,7 @@ Staff_symbol::print (SCM smob)
   do
     {
       SCM width_scm = me->get_property ("width");
-      if (d == RIGHT && is_number (width_scm))
+      if (d == RIGHT && ly_c_number_p (width_scm))
        {
          /*
            don't multiply by Staff_symbol_referencer::staff_space (me),
@@ -95,7 +95,7 @@ int
 Staff_symbol::line_count (Grob*me) 
 {
   SCM c = me->get_property ("line-count");
-  if (is_number (c))
+  if (ly_c_number_p (c))
     return ly_scm2int (c);
   else
     return 0;
index a0adf56d6dd36b9dfc39346d52163219acf512fc..14de1ade5c36272a0a76184ce046e6a7de11baa6 100644 (file)
@@ -83,7 +83,7 @@ Stem_engraver::acknowledge_grob (Grob_info i)
              int requested_type = ly_scm2int (tremolo_ev_->get_property ("tremolo-type"));
              SCM f = get_property ("tremoloFlags");
              if (!requested_type)
-               if (is_number (f))
+               if (ly_c_number_p (f))
                  requested_type = ly_scm2int (f);
                else
                  requested_type = 8; 
@@ -149,13 +149,13 @@ Stem_engraver::stop_translation_timestep ()
        toDO: junk these properties.
        */
       SCM prop = get_property ("stemLeftBeamCount");
-      if (is_number (prop))
+      if (ly_c_number_p (prop))
        {
          Stem::set_beaming (stem_,ly_scm2int (prop),LEFT);
          get_parent_context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
        }
       prop = get_property ("stemRightBeamCount");
-      if (is_number (prop))
+      if (ly_c_number_p (prop))
        {
          Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT);
          get_parent_context ()->unset_property (ly_symbol2scm ("stemRightBeamCount"));
index 30580422f3a0b4bc13137e45379a0068520a160e..4ddd2b2db1a1c90137d791c3986e9d508706f398 100644 (file)
@@ -92,7 +92,7 @@ Stem_tremolo::raw_stencil (Grob *me)
   
   int tremolo_flags = 0;
   SCM s = me->get_property ("flag-count");
-  if (is_number (s))
+  if (ly_c_number_p (s))
     tremolo_flags = ly_scm2int (s);
 
   if (!tremolo_flags)
@@ -150,7 +150,7 @@ Stem_tremolo::print (SCM grob)
 
   Real beamthickness = 0.0;
   SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
-  if (is_number (sbt))
+  if (ly_c_number_p (sbt))
     {
       beamthickness = ly_scm2double (sbt) * ss;
     }
index b53fac3897f70406179bc7ccd6e1ec39f1d2cd45..cbf298745ba7b5c97e1ac7ef4d034e079c42a7f3 100644 (file)
@@ -83,7 +83,7 @@ Stem::stem_end_position (Grob*me)
 {
   SCM p =me->get_property ("stem-end-position");
   Real pos;
-  if (!is_number (p))
+  if (!ly_c_number_p (p))
     {
       pos = get_default_stem_end_position (me);
       me->set_property ("stem-end-position", scm_make_real (pos));
@@ -289,7 +289,7 @@ Stem::get_default_stem_end_position (Grob*me)
   
   Real length = 7;             // WARNING: IN HALF SPACES
   SCM scm_len = me->get_property ("length");
-  if (is_number (scm_len))
+  if (ly_c_number_p (scm_len))
     {
       length = ly_scm2double (scm_len);
     }
@@ -429,7 +429,7 @@ int
 Stem::duration_log (Grob*me) 
 {
   SCM s = me->get_property ("duration-log");
-  return (is_number (s)) ? ly_scm2int (s) : 2;
+  return (ly_c_number_p (s)) ? ly_scm2int (s) : 2;
 }
 
 void
index 44beeb460057a534cb1e5130cc00db1a37c00074..8c986b2a7105a4a82467e00ca2cd4126c159e554 100644 (file)
@@ -40,7 +40,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
 {
   Stencil *s = unsmob_stencil (stil);
   SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+  SCM_ASSERT_TYPE (ly_c_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
   SCM new_s = s->smobbed_copy ();
@@ -106,13 +106,13 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
       p = ly_scm2double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
       m = ly_scm2double (minimum);
     }
 
@@ -151,13 +151,13 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   Real p = 0.0;
   if (padding != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
       p = ly_scm2double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
-      SCM_ASSERT_TYPE (is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
+      SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
       m = ly_scm2double (minimum);
     }
 
@@ -219,7 +219,7 @@ LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!",
 {
   SCM_ASSERT_TYPE (unsmob_stencil (stil), stil, SCM_ARG1, __FUNCTION__, "stencil");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (is_number (dir), dir, SCM_ARG3, __FUNCTION__, "number");
+  SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
 
   unsmob_stencil (stil)->align_to ((Axis)ly_scm2int (axis),
                                   ly_scm2double (dir));
index 87373b5de83405b0dc93d0884aa8d0218b587e78..503a81b28bf8b44ed855000e2cc0c1081cc18c18 100644 (file)
@@ -369,7 +369,7 @@ System::get_line ()
                Grob *col = it->get_column ();
                SCM s = col->get_property ("page-penalty");
                // FIXME; page breaking is not discrete at +-10000
-               if (is_number (s)) // && fabs (ly_scm2double (s)) < 10000)
+               if (ly_c_number_p (s)) // && fabs (ly_scm2double (s)) < 10000)
                  penalty += ly_scm2double (s);
              }
          }
index af564200bd5b1b893a0db8e8325c10f75808613b..ecca3ed9e5386cc9b8e1c275ae9f2724611e81ab 100644 (file)
@@ -131,7 +131,7 @@ Tab_note_heads_engraver::process_music ()
       SCM scm_pitch = event->get_property ("pitch");
       SCM proc      = get_property ("tablatureFormat");
       SCM min_fret_scm = get_property ("minimumFret");
-      int min_fret = is_number (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0;
+      int min_fret = ly_c_number_p (min_fret_scm) ? ly_scm2int (min_fret_scm) : 0;
 
       while (!string_found)
        {
index c7f87db6f84a58b1f522de863c9ba8f7f45b906d..d398f4b2e7f697243c12b202513c3c3c656d5677 100644 (file)
@@ -93,7 +93,7 @@ Text_engraver::process_acknowledged_grobs ()
       // Hmm
       int priority = 200;
       SCM s = text->get_property ("script-priority");
-      if (is_number (s))
+      if (ly_c_number_p (s))
        priority = ly_scm2int (s);
       
       /* see script-engraver.cc */
index 15c3866a3ebe6bbb7e3f986c3f342d7107c8cd8f..cc96ec066d3a0fd640ce464bbe64d44d92fc79b9 100644 (file)
@@ -133,7 +133,7 @@ Timing_translator::start_translation_timestep ()
   
   SCM barn = get_property ("currentBarNumber");
   int b = 0;
-  if (is_number (barn))
+  if (ly_c_number_p (barn))
     {
       b = ly_scm2int (barn);
     }
index f4126189c7056a0a2f7e7fb31d520d66113b1468..d2514ccc8d859bb6845d3c3f911a9bfae655eac6 100644 (file)
@@ -108,7 +108,7 @@ void
 recurse_over_translators (Context * c, Translator_method ptr, Direction dir)
 {
   Translator_group * tg
-    = dynamic_cast<Translator_group*> (unsmob_translator (c->implementation_));
+    = dynamic_cast<Translator_group*> (c->implementation ());
 
 
   /*
index ba44e4446ba12c84bbaa8fb8fe25a87cc71f51f3..2c87802a08d651d3c954b06cbb4f50bebca6268c 100644 (file)
@@ -114,7 +114,7 @@ Tuplet_bracket::print (SCM smob)
     SCM lp = me->get_property ("left-position");
     SCM rp = me->get_property ("right-position");  
 
-    if (!is_number (rp) || !is_number (lp))
+    if (!ly_c_number_p (rp) || !ly_c_number_p (lp))
       after_line_breaking (smob);
   }
   
@@ -487,15 +487,15 @@ Tuplet_bracket::after_line_breaking (SCM smob)
   SCM lp =  me->get_property ("left-position");
   SCM rp = me->get_property ("right-position");  
   
-  if (is_number (lp) && !is_number (rp))
+  if (ly_c_number_p (lp) && !ly_c_number_p (rp))
     {
       rp = scm_make_real (ly_scm2double (lp) + dy);
     }
-  else if (is_number (rp) && !is_number (lp))
+  else if (ly_c_number_p (rp) && !ly_c_number_p (lp))
     {
       lp = scm_make_real (ly_scm2double (rp) - dy);
     }
-  else if (!is_number (rp) && !is_number (lp))
+  else if (!ly_c_number_p (rp) && !ly_c_number_p (lp))
     {
       lp = scm_make_real (offset);
       rp = scm_make_real (offset +dy);
index f25e6a9c16b7a8af156e88874e5a056ce460c9b4..a2824760092afe13a92730e1a22a47869dc839c8 100644 (file)
@@ -33,7 +33,7 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list)
          *tail =  scm_cons (ly_car (s),SCM_EOL);
          tail = SCM_CDRLOC (*tail);
 
-         if (!is_number (mag))
+         if (!ly_c_number_p (mag))
            /* Ugh.  */
            mag = ly_cdr (fm->description_);