]> git.donarmstrong.com Git - lilypond.git/commitdiff
(main): don't identify binary.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 29 Aug 2003 22:28:37 +0000 (22:28 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 29 Aug 2003 22:28:37 +0000 (22:28 +0000)
29 files changed:
ChangeLog
lily/accidental-engraver.cc
lily/auto-change-iterator.cc
lily/axis-group-engraver.cc
lily/change-iterator.cc
lily/context-specced-music-iterator.cc
lily/include/auto-change-iterator.hh
lily/include/part-combine-music-iterator.hh
lily/include/translator-def.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/lyric-phrasing-engraver.cc
lily/main.cc
lily/music-output-def.cc
lily/new-accidental-engraver.cc
lily/note-head-line-engraver.cc
lily/parser.yy
lily/part-combine-music-iterator.cc
lily/simultaneous-music-iterator.cc
lily/translator-def.cc
lily/translator-group.cc
lily/translator-scheme.cc
lily/translator.cc
ly/property-init.ly
scm/define-music-properties.scm
scm/drums.scm
scm/music-functions.scm
scripts/convert-ly.py
scripts/lilypond.py

index 4796f798b26969bdb85236ffa04c9ce53631a93a..84af28851551acc60ce80e23b4154325160caeb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
+2003-08-30  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/main.cc (main): don't identify binary.
+
 2003-08-29  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/include/translator.hh (class Translator): remove
+       type_string_ , use symbol for context name throughout.
+       Changes through whole source tree.
+
        * scripts/lilypond.py: rename ly2dvi.py to lilypond.py
        set PDF as default, and always make PDF.
 
index 23958478898ae7a1fec65e7335531cd8481e74e1..e7ee7654635d52345522c40991ec9ed317352697 100644 (file)
@@ -203,14 +203,13 @@ number_accidentals (Music * note, Pitch *pitch, Translator_group * origin,
       */
       else if (gh_symbol_p (ly_car (accidentals)))
        {
-         String context = ly_symbol2string (ly_car (accidentals));
-         
+         SCM context =ly_car (accidentals);
          while (origin && !origin->is_alias_b (context))
            origin = origin->daddy_trans_;
       
          if (!origin)
            warning (_f ("Symbol is not a parent context: %s. Ignored", 
-                        context.to_str0 ()));
+                        ly_symbol2string (context).to_str0 ()));
        }
       else warning (_f ("Accidental typesetting must be pair or context-name: %s", 
                        ly_scm2string (ly_car (accidentals)).to_str0 ()));
index d57960f9bba1ac799af0f34573f7bdd661864025..51e2284b2fbb61673fcb1ee3eee0b8ce406eb784 100644 (file)
@@ -15,7 +15,7 @@
 
 
 void
-Auto_change_iterator::change_to (Music_iterator *it, String to_type,
+Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
                                 String to_id)
 {
   Translator_group * current = it->report_to ();
@@ -31,7 +31,7 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type,
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && current->type_string_ != to_type)
+  while (current && !current->is_alias_b (to_type_sym))
     {
       last = current;
       current = current->daddy_trans_;
@@ -47,7 +47,7 @@ Auto_change_iterator::change_to (Music_iterator *it, String to_type,
     if (last)
       {
        Translator_group * dest = 
-         it->report_to ()->find_create_translator (to_type, to_id);
+         it->report_to ()->find_create_translator (to_type_sym, to_id);
        current->remove_translator (last);
        dest->add_used_group_translator (last);
       }
@@ -134,8 +134,7 @@ Auto_change_iterator::process (Moment m)
        {
          where_dir_ = s;
          String to_id = (s >= 0) ?  "up" : "down";
-         String wh = ly_scm2string (get_music ()->get_mus_property ("what"));
-         change_to (child_iter_, wh, to_id);     
+         change_to (child_iter_, get_music ()->get_mus_property ("what"), to_id);        
        }
     }
 }
index 90d9cc086149fa77ffd30f9593f70f566e2af9de..bd728738f3e75ad7c1a1884c6dddd36ff98def94 100644 (file)
@@ -59,7 +59,7 @@ Axis_group_engraver::get_spanner () const
 void
 Axis_group_engraver::finalize ()
 {
-  String type = get_daddy_grav ()->type_string_ ;
+  String type = get_daddy_grav ()->context_name ();
   SCM dims = get_property ("verticalExtent");
   
   if (gh_pair_p (dims) && gh_number_p (ly_car (dims))
index b07781ebcb9edcb3f729be2def1a5822810fd1ef..b8ccb356b1cf904fa1129be1b3055db7bde53c94 100644 (file)
@@ -21,11 +21,12 @@ Change_iterator::error (String reason)
 
   String warn1 = _f ("can't change `%s' to `%s'", to_type, to_id) 
     + ": " + reason;
+
   /*
     GUHG!
    */
   String warn2= "Change_iterator::process (): " 
-    + report_to ()->type_string_ + " = `"
+    + report_to ()->context_name () + " = `"
     + report_to ()->id_string_ + "': ";
   warning (warn2);
   get_music ()->origin ()->warning (warn1);
@@ -40,7 +41,7 @@ Change_iterator::process (Moment m)
   Translator_group * current = report_to ();
   Translator_group * last = 0;
 
-  String to_type = ly_scm2string (get_music ()->get_mus_property ("change-to-type"));
+  SCM to_type = get_music ()->get_mus_property ("change-to-type");
   String to_id =  ly_scm2string (get_music ()->get_mus_property ("change-to-id"));
 
 
@@ -48,7 +49,7 @@ Change_iterator::process (Moment m)
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && current->type_string_ != to_type)
+  while (current && !current->is_alias_b (to_type))
     {
       last = current;
       current = current->daddy_trans_;
index f1e64ba558a829c31d23f2b9ff01d0d1a29e0dc1..a5b808a9ba0c0b62b50e7b3f9871a1c8e60d76a3 100644 (file)
@@ -23,17 +23,14 @@ void
 Context_specced_music_iterator::construct_children ()
 {
   SCM ct = get_music ()->get_mus_property ("context-type");
-  String c_type;
-  if (gh_string_p (ct))
-    c_type =  ly_scm2string (ct);
-  
+
   String c_id;
   SCM ci = get_music ()->get_mus_property ("context-id");
   if (gh_string_p (ci))
     c_id = ly_scm2string (ci);
   
   Translator_group* a
-    =report_to ()->find_create_translator (c_type, c_id);
+    =report_to ()->find_create_translator (ct, c_id);
   
   set_translator (a);
 
index 4e71a300db71a820844a478d57c9b9a2fb320893..896de1b2588cd7d7b0a53c6eb985e0426b9eb7d7 100644 (file)
@@ -26,7 +26,7 @@ protected:
   Array<Pitch> pending_pitch (Moment)const;
 private:
   Direction where_dir_;
-  void change_to (Music_iterator* , String, String);
+  void change_to (Music_iterator* , SCM, String);
 };
 
 #endif /* AUTO_CHANGE_ITERATOR_HH */
index 80ddf1eb42c7cbc52de4d0a5396b458c83218a23..8d6d6a18d9152d7a2070a826eecd4760d45ccf81 100644 (file)
@@ -32,7 +32,7 @@ protected:
   virtual bool ok () const;
 
 private:
-  void change_to (Music_iterator*, String, String);
+  void change_to (Music_iterator*, SCM,  String);
   int get_state (Moment m);
 
   Music_iterator * first_iter_;
index 0c3d8457f524aa113f32a0fb77fbcab2b2f0eb2f..844bf8178c53c4b0dba9e96899b2047dcf4d8f2c 100644 (file)
@@ -31,7 +31,10 @@ private:
   SCM property_ops_;
 
 public:
-  SCM description_; 
+  SCM description_;
+  /*
+    "type" is overloaded.
+   */
   SCM type_name_;
   SCM type_aliases_;
   SCM translator_group_type_;
index 4a40e0720844d2bd7b2e5d2b908e5a4378dceab1..87b9616339a6dd7b8799d09d82fad15068c066ac 100644 (file)
@@ -34,9 +34,10 @@ class Translator_group : public virtual Translator {
 
   friend class Interpretation_context_handle;
   SCM add_translator (SCM, Translator*);
-
+  
 protected:
   ~Translator_group ();
+
 public:
   void execute_pushpop_property (SCM prop, SCM sym, SCM val);
   SCM internal_get_property (SCM name_sym) const;
@@ -47,7 +48,7 @@ public:
   Translator_group *where_defined (SCM name_sym) const;
 
   String id_string_;
-
+  String context_name () const;  
   VIRTUAL_COPY_CONS (Translator);
   Translator_group (Translator_group const &);
   Translator_group ();
@@ -63,9 +64,10 @@ public:
   Translator *remove_translator (Translator*trans);
   void check_removal ();
   // Translator *get_simple_translator (String) const;
-  Translator_group *find_existing_translator (String n, String id);
-  Translator_group *find_create_translator (String n, String id);
-  Link_array<Translator_group> path_to_acceptable_translator (String alias, Music_output_def*) const;
+  Translator_group *find_existing_translator (SCM context_name, String id);
+  Translator_group *find_create_translator (SCM context_name, String id);
+  Link_array<Translator_group> path_to_acceptable_translator (SCM alias,
+                                                             Music_output_def*) const;
   Translator_group*get_default_interpreter ();
 
 public:
index eaafa53145a53a04159f04fc05cff7bc80a37968..81b95bbdf76500f7f5f44b2e2f2c070dc9e35d65 100644 (file)
@@ -37,11 +37,8 @@ class Translator
   void init ();
 public:
   Music_output_def * output_def_;
-  String type_string_;
   
-  bool is_alias_b (String) const;
-    
-
+  bool is_alias_b (SCM) const;
   Translator (Translator const &);
 
   
@@ -62,7 +59,6 @@ public:
   SCM simple_trans_list_;
   SCM trans_group_list_;
   SCM definition_;
-  
   SCM properties_scm_;
   DECLARE_SMOBS (Translator, dummy);
 
@@ -88,7 +84,6 @@ static void  _ ## T ## _adder () {\
       T *t = new T;\
       T::static_description_ = t->static_translator_description ();\
       scm_permanent_object (T::static_description_);\
-      t->type_string_ = classname (t);\
       add_translator (t);\
 }\
 SCM T::translator_description() const\
index 904b78f79a56a4303dfcf05d6e7395d0adad768c..fab2a8e607c9f4a5ab010b4cd02512b3e95658e4 100644 (file)
@@ -14,7 +14,7 @@
 #include "warn.hh"
 
 
-String get_context_id (Translator_group * ancestor, const char * type);
+String get_context_id (Translator_group * ancestor, SCM);
 String trim_suffix (String &id);
 
 
@@ -200,7 +200,7 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i)
       /* caught a note head ... do something with it */
 
       /* what's its Voice context name? */
-      String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "Voice");
+      String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, ly_symbol2scm ("Voice"));
       record_notehead (voice_context_id, h);
 
       /* is it in a melisma ? */
@@ -224,7 +224,7 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i)
        }
       else
        {
-         voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "LyricsVoice");
+         voice_context_id = get_context_id (i.origin_trans_->daddy_trans_,ly_symbol2scm ( "LyricsVoice"));
          voice_context_id = trim_suffix (voice_context_id);
        }
       record_lyric (voice_context_id, h);
@@ -246,16 +246,16 @@ Lyric_phrasing_engraver::acknowledge_grob (Grob_info i)
   */
   if (h->internal_has_interface (ly_symbol2scm ("lyric-extender-interface")))
     {
-      String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, "LyricsVoice");
+      String voice_context_id = get_context_id (i.origin_trans_->daddy_trans_, ly_symbol2scm ("LyricsVoice"));
       record_extender (trim_suffix (voice_context_id), h);
       return;
     }
 }
 
 String 
-get_context_id (Translator_group * ancestor, const char *type)
+get_context_id (Translator_group * ancestor, SCM  type)
 {
-  while (ancestor != 0 && ancestor->type_string_ != type)
+  while (ancestor != 0 && !ancestor->is_alias_b(type))
     {
       ancestor = ancestor->daddy_trans_;
     }
index ef55cffc5621b99713db487d3ebd43c0861c622c..6ea0664d18d9fa0f6d7e1a1ab8047bd1a18a4400 100644 (file)
@@ -490,7 +490,6 @@ main (int argc, char **argv)
          break;
        }
     }
-  identify (stderr);
 
   if (help_b)
     {
index e8ae40ccfd1919e95d36ec65d382d978784e03c1..f9a305127c15decaaecc23af12ddf4b3e2d09b47 100644 (file)
@@ -77,23 +77,15 @@ Music_output_def::assign_translator (SCM transdef)
   Translator_def *tp = unsmob_translator_def (transdef);
   assert (tp);
 
-  
-  SCM s = ly_symbol2scm ("");
-  if (gh_string_p (tp->type_name_))
-    s = scm_string_to_symbol (tp->type_name_);
-
-  translator_tab_->set (s, transdef);
+  translator_tab_->set (tp->type_name_, transdef);
 }
 
 /*
-  find the translator for NAME. NAME may be a string or a symbol.
+  find the translator for NAME. NAME must be a symbol.
  */
 SCM
 Music_output_def::find_translator (SCM name) const
 {  
-  if (gh_string_p (name))
-    name = scm_string_to_symbol (name);
-  
   SCM val  =SCM_EOL;
   translator_tab_->try_retrieve (name, &val);
   return val;
index bb1b7b71818098fcc0543bbc347fc82277a8f10f..4d2cad0b29b6714740b892ab9ff2f5504ad2ff16 100644 (file)
@@ -270,14 +270,14 @@ number_accidentals (Music * note, Pitch *pitch, Translator_group * origin,
       */
       else if (gh_symbol_p (ly_car (accidentals)))
        {
-         String context = ly_symbol2string (ly_car (accidentals));
+         SCM context = ly_car (accidentals);
          
          while (origin && !origin->is_alias_b (context))
            origin = origin->daddy_trans_;
       
          if (!origin)
            warning (_f ("Symbol is not a parent context: %s. Ignored", 
-                        context.to_str0 ()));
+                        ly_symbol2string (context).to_str0 ()));
        }
       else warning (_f ("Accidental typesetting must be pair or context-name: %s", 
                        ly_scm2string (ly_car (accidentals)).to_str0 ()));
index 57ad1be1246abc0710a360fa4b6dc2d83de26a1f..84e8af265201aec998793328b8b3c5b3f5ad8b06 100644 (file)
@@ -60,10 +60,10 @@ Note_head_line_engraver::acknowledge_grob (Grob_info info)
       if (to_boolean (get_property ("followVoice")))
        {
          Translator_group  * tr = daddy_trans_;
-         while (tr && tr->type_string_ != "Staff")
+         while (tr && !tr->is_alias_b (ly_symbol2scm ( "Staff")))
            tr = tr->daddy_trans_ ;
 
-         if (tr && tr->type_string_ == "Staff" && tr != last_staff_)
+         if (tr && tr->is_alias_b (ly_symbol2scm ("Staff")) && tr != last_staff_)
            {
              if (last_head_)
                follow_ = true;
index 87cb02513086e3fc5a249697f332a1042333cbfa..fdf8f5c3d9eebc8db6244259f73b33810317c404 100644 (file)
@@ -575,7 +575,7 @@ translator_spec_body:
                scm_string_to_symbol ($2), $4);
        }
        | translator_spec_body NAME STRING  {
-               unsmob_translator_def ($$)->type_name_ = $3;
+               unsmob_translator_def ($$)->type_name_ = scm_string_to_symbol ($3);
        }
        | translator_spec_body CONSISTS STRING  {
                unsmob_translator_def ($$)->add_element ($3);
@@ -594,10 +594,10 @@ translator_spec_body:
                unsmob_translator_def ($$)->add_last_element ( $3);
        }
        | translator_spec_body ACCEPTS STRING  {
-               unsmob_translator_def ($$)->set_acceptor ($3,true);
+               unsmob_translator_def ($$)->set_acceptor (scm_string_to_symbol ($3), true);
        }
        | translator_spec_body DENIES STRING  {
-               unsmob_translator_def ($$)->set_acceptor ($3,false);
+               unsmob_translator_def ($$)->set_acceptor (scm_string_to_symbol ($3), false);
        }
        | translator_spec_body REMOVE STRING  {
                unsmob_translator_def ($$)->remove_element ($3);
@@ -917,7 +917,7 @@ Composite_music:
                csm->set_mus_property ("element", $3->self_scm ());
                scm_gc_unprotect_object ($3->self_scm ());
 
-               csm->set_mus_property ("context-type",$2);
+               csm->set_mus_property ("context-type", scm_string_to_symbol ($2));
                csm->set_mus_property ("context-id", scm_makfrom0str (""));
 
                $$ = csm;
@@ -928,7 +928,7 @@ Composite_music:
                chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
 
                scm_gc_unprotect_object ($3->self_scm ());
-               chm->set_mus_property ("what", $2); 
+               chm->set_mus_property ("what", scm_string_to_symbol ($2));
 
                $$ = chm;
                chm->set_spot (*$3->origin ());
@@ -990,7 +990,7 @@ basic music objects too, since the meaning is different.
                csm->set_mus_property ("element", $5->self_scm ());
                scm_gc_unprotect_object ($5->self_scm ());
 
-               csm->set_mus_property ("context-type", $2);
+               csm->set_mus_property ("context-type", scm_string_to_symbol ($2));
                csm->set_mus_property ("context-id", $4);
 
                $$ = csm;
@@ -1003,7 +1003,7 @@ basic music objects too, since the meaning is different.
                csm->set_mus_property ("element", $3->self_scm ());
                scm_gc_unprotect_object ($3->self_scm ());
 
-               csm->set_mus_property ("context-type", $2);
+               csm->set_mus_property ("context-type", scm_string_to_symbol ($2));
 
                SCM new_id = scm_number_to_string (gh_int2scm (new_context_count ++),
                                        gh_int2scm (10));
@@ -1019,9 +1019,9 @@ basic music objects too, since the meaning is different.
        {
                int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
                Music *mp = $4;
-       $$= MY_MAKE_MUSIC("TimeScaledMusic");
-               $$->set_spot (THIS->pop_spot ());
 
+               $$= MY_MAKE_MUSIC("TimeScaledMusic");
+               $$->set_spot (THIS->pop_spot ());
 
                $$->set_mus_property ("element", mp->self_scm ());
                scm_gc_unprotect_object (mp->self_scm ());
@@ -1123,8 +1123,8 @@ re_rhythmed_music:
 
 part_combined_music:
        PARTCOMBINE STRING Music Music {
-       Music * p= MY_MAKE_MUSIC("PartCombineMusic");
-               p->set_mus_property ("what", $2);
+               Music * p= MY_MAKE_MUSIC("PartCombineMusic");
+               p->set_mus_property ("what", scm_string_to_symbol ($2));
                p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED));  
 
                scm_gc_unprotect_object ($3->self_scm ());
@@ -1137,7 +1137,7 @@ part_combined_music:
 translator_change:
        TRANSLATOR STRING '=' STRING  {
                Music*t= MY_MAKE_MUSIC("TranslatorChange");
-               t-> set_mus_property ("change-to-type", $2);
+               t-> set_mus_property ("change-to-type", scm_string_to_symbol ($2));
                t-> set_mus_property ("change-to-id", $4);
 
                $$ = t;
@@ -1165,7 +1165,7 @@ simple_property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> set_mus_property ("context-type", $2);
+               csm-> set_mus_property ("context-type", scm_string_to_symbol ($2));
        }
        | PROPERTY STRING '.' STRING UNSET {
                
@@ -1179,7 +1179,7 @@ simple_property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> set_mus_property ("context-type", $2);
+               csm-> set_mus_property ("context-type", scm_string_to_symbol ($2));
        }
        | PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
                bool autobeam
@@ -1201,7 +1201,7 @@ simple_property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> set_mus_property ("context-type", $2);
+               csm-> set_mus_property ("context-type", scm_string_to_symbol ($2));
        }
        | PROPERTY STRING '.' STRING OVERRIDE
                embedded_scm '=' embedded_scm
@@ -1229,7 +1229,7 @@ simple_property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> set_mus_property ("context-type", $2);
+               csm-> set_mus_property ("context-type", scm_string_to_symbol ($2));
 
        }
        | PROPERTY STRING '.' STRING REVERT embedded_scm {
@@ -1252,7 +1252,7 @@ simple_property_def:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm-> set_mus_property ("context-type", $2);
+               csm-> set_mus_property ("context-type", scm_string_to_symbol ($2));
        }
        ;
 
@@ -1409,7 +1409,7 @@ command_element:
                $$ = csm;
                $$->set_spot (THIS->here_input ());
 
-               csm->set_mus_property ("context-type", scm_makfrom0str ("Timing"));
+               csm->set_mus_property ("context-type", ly_symbol2scm ("Timing"));
        }
        | PARTIAL duration_length       {
                Moment m = - unsmob_duration ($2)->get_length ();
@@ -1420,7 +1420,7 @@ command_element:
                scm_gc_unprotect_object (p->self_scm ());
 
                $$ =sp ;
-               sp-> set_mus_property ("context-type", scm_makfrom0str ("Timing"));
+               sp-> set_mus_property ("context-type", ly_symbol2scm ("Timing"));
        }
        | CLEF STRING  {
                static SCM proc ;
index b249224f3b368ed4da4d051daf2e0b8597b19e13..0aa59eb11d84093bbeedb48db446e9761d2699c8 100644 (file)
@@ -92,7 +92,7 @@ Part_combine_music_iterator::construct_children ()
 }
 
 void
-Part_combine_music_iterator::change_to (Music_iterator *it, String to_type,
+Part_combine_music_iterator::change_to (Music_iterator *it, SCM to_type,
                                        String to_id)
 {
   Translator_group * current = it->report_to ();
@@ -108,7 +108,7 @@ Part_combine_music_iterator::change_to (Music_iterator *it, String to_type,
      
      If \translator Staff = bass, then look for Staff = *
    */
-  while (current && current->type_string_ != to_type)
+  while (current && !current->is_alias_b (to_type))
     {
       last = current;
       current = current->daddy_trans_;
@@ -136,7 +136,7 @@ Part_combine_music_iterator::change_to (Music_iterator *it, String to_type,
          
           last->translator_id_string_  = get_change ()->change_to_id_string_;
        */
-       error (_f ("I'm one myself: `%s'", to_type.to_str0 ()));
+       error (_f ("I'm one myself: `%s'", ly_symbol2string (to_type).to_str0 ()));
       }
   else
     error (_f ("none of these in my family: `%s'", to_id.to_str0 ()));
@@ -169,7 +169,7 @@ Part_combine_music_iterator::get_state (Moment)
   
   Music *p = get_music ();
 
-  String w = ly_scm2string (p->get_mus_property ("what"));
+  SCM w = p->get_mus_property ("what");
     
   
   Translator_group *first_translator = first_iter_->report_to ()->find_create_translator (w, "one" + suffix_);
@@ -394,7 +394,7 @@ s      Consider thread switching: threads "one", "two" and "both".
       if (second_iter_ && second_iter_->ok ())
        second_iter_->try_music (abort_req);
      }
-  String w = ly_scm2string (p->get_mus_property ("what"));
+  SCM  w = p->get_mus_property ("what");
   if (combine_b != previously_combined_b)
     change_to (second_iter_, w, (combine_b ? "one" : "two")
               + suffix_);
index 92e244974e7e1ad47424b766acb0ec082879ee16..6a93ab7b0cc63b13f75cdc4434da6e6c00971486 100644 (file)
@@ -10,7 +10,7 @@
 #include "warn.hh"
 #include "simultaneous-music-iterator.hh"
 #include "music-list.hh"
-#include "killing-cons.tcc"
+#include "translator-def.hh"
 
 
 Simultaneous_music_iterator::Simultaneous_music_iterator ()
@@ -76,10 +76,10 @@ Simultaneous_music_iterator::construct_children ()
 
       /* if separate_contexts_b_ is set, create a new context with the
         number number as name */
-      
+
+      SCM name = unsmob_translator_def (report_to ()->definition_)->type_name_;
       Translator_group * t = (j && separate_contexts_b_)
-       ? report_to ()->find_create_translator (report_to ()->type_string_,
-                                                   to_string (j))
+       ? report_to ()->find_create_translator (name, to_string (j))
        : report_to ();
 
       if (!t)
index de404836ed74a66b740f1aa377484730fd3e2242..3e15e61b4054c6a2bef375cd4fca0beb4449818a 100644 (file)
@@ -90,6 +90,7 @@ Translator_def::Translator_def (Translator_def const & s)
 void
 Translator_def::set_acceptor (SCM name, bool add)
 {
+  assert (gh_symbol_p (name));
   if (add)
     this->accepts_name_list_ = gh_cons (name, this->accepts_name_list_);
   else
@@ -159,9 +160,9 @@ Translator_def::add_pop_property (SCM props, SCM syms)
 
 
 Link_array<Translator_def>
-Translator_def::path_to_acceptable_translator (SCM type_string, Music_output_def* odef) const
+Translator_def::path_to_acceptable_translator (SCM type_sym, Music_output_def* odef) const
 {
-  assert (gh_string_p (type_string));
+  assert (gh_symbol_p (type_sym));
   
   Link_array<Translator_def> accepteds;
   for (SCM s = accepts_name_list_; gh_pair_p (s); s = ly_cdr (s))
@@ -179,7 +180,7 @@ Translator_def::path_to_acceptable_translator (SCM type_string, Music_output_def
       /*
        don't check aliases, because \context Staff should not create RhythmicStaff.
       */
-      if (gh_equal_p (accepteds[i]->type_name_, type_string))
+      if (gh_equal_p (accepteds[i]->type_name_, type_sym))
        {
          best_result.push (accepteds[i]);
          return best_result;
@@ -192,11 +193,17 @@ Translator_def::path_to_acceptable_translator (SCM type_string, Music_output_def
       Translator_def * g = accepteds[i];
 
       Link_array<Translator_def> result
-       = g->path_to_acceptable_translator (type_string, odef);
+       = g->path_to_acceptable_translator (type_sym, odef);
       if (result.size () && result.size () < best_depth)
        {
          result.insert (g,0);
          best_result = result;
+
+         /*
+           this following line was added in 1.9.3, but hsould've been
+           there all along... Let's hope it doesn't cause nightmares.
+          */
+         best_depth = result.size();
        }
     }
 
@@ -241,7 +248,6 @@ Translator_def::instantiate (Music_output_def* md)
   Translator_group *tg = dynamic_cast<Translator_group*> (g);
   tg->output_def_ = md;
   tg->definition_ = self_scm ();
-  tg->type_string_ = ly_scm2string (type_name_);
 
   /*
     TODO: ugh. we're reversing CONSISTS_NAME_LIST_ here
index f57e3ecfb69ecdd00caaaef61ee3c5292e758845..ac4e97eb2a5ec8312b9a6b672bcd2602715e619e 100644 (file)
@@ -105,9 +105,9 @@ Translator_group::removable_b () const
 }
 
 Translator_group *
-Translator_group::find_existing_translator (String n, String id)
+Translator_group::find_existing_translator (SCM n, String id)
 {
-  if ((is_alias_b (n) && (id_string_ == id || id.empty_b ())) || n == "Current")
+  if ((is_alias_b (n) && (id_string_ == id || id.empty_b ())) || n == ly_symbol2scm ("Current"))
     return this;
 
   Translator_group* r = 0;
@@ -123,14 +123,14 @@ Translator_group::find_existing_translator (String n, String id)
 
 
 Translator_group*
-Translator_group::find_create_translator (String n, String id)
+Translator_group::find_create_translator (SCM n, String id)
 {
   Translator_group * existing = find_existing_translator (n,id);
   if (existing)
     return existing;
 
   Link_array<Translator_def> path
-    = unsmob_translator_def (definition_)->path_to_acceptable_translator (scm_makfrom0str ((char*)n.to_str0 ()), get_output_def ());
+    = unsmob_translator_def (definition_)->path_to_acceptable_translator (n, get_output_def ());
 
   if (path.size ())
     {
@@ -155,7 +155,7 @@ Translator_group::find_create_translator (String n, String id)
     ret = daddy_trans_->find_create_translator (n,id);
   else
     {
-      warning (_f ("can't find or create `%s' called `%s'", n, id));
+      warning (_f ("can't find or create `%s' called `%s'", ly_symbol2string (n).to_str0 (), id));
       ret =0;
     }
   return ret;
@@ -213,7 +213,7 @@ Translator_group::remove_translator (Translator*trans)
 bool
 Translator_group::is_bottom_translator_b () const
 {
-  return !gh_string_p (unsmob_translator_def (definition_)->default_child_context_name ());
+  return !gh_symbol_p (unsmob_translator_def (definition_)->default_child_context_name ());
 }
 
 Translator_group*
@@ -455,4 +455,10 @@ Translator_group::properties_as_alist () const
 {
   return properties_dict()->to_alist();
 }
-  
+
+String
+Translator_group::context_name () const
+{
+  Translator_def * td = unsmob_translator_def (definition_ );
+  return ly_symbol2string (td->type_name_);
+}
index ed42abdb1889f036685795677d1e97ce4afd7b7a..9a7bf5c065fe67a04a2c614ae5d620fb92118c19 100644 (file)
@@ -109,13 +109,11 @@ LY_DEFINE(ly_translator_find,
   Translator_group* tr=   dynamic_cast<Translator_group*> ( unsmob_translator (context));
 
   SCM_ASSERT_TYPE(tr, context, SCM_ARG1, __FUNCTION__, "context");
-  SCM_ASSERT_TYPE(gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string");
-  
-  String s = ly_scm2string (name);
+  SCM_ASSERT_TYPE(gh_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
   
   while (tr)
     {
-      if (tr->is_alias_b (s))
+      if (tr->is_alias_b (name))
        return tr->self_scm();
       tr =  tr->daddy_trans_ ;
     }
index 7d2bdbc702e42a44421a65f7d7d8bdb7c3688c90..3e440ab335965a980109ee2f61e7e1dea3610518 100644 (file)
@@ -43,19 +43,18 @@ Translator::Translator (Translator const &s)
   self_scm_ = SCM_EOL;
   init ();
   output_def_ = s.output_def_;
-  type_string_ = s.type_string_;
 
   smobify_self ();
 }
 
 bool
-Translator::is_alias_b (String s) const
+Translator::is_alias_b (SCM sym) const
 {
-  bool b  = s == type_string_;
+  Translator_def * td = unsmob_translator_def (definition_);
+  bool b  = (sym == td->type_name_);
 
-  for (SCM a = unsmob_translator_def (definition_)->type_aliases_;
-       !b && gh_pair_p (a); a = ly_cdr (a))
-    b = b || s == ly_scm2string (ly_car (a));
+  for (SCM a = td->type_aliases_; !b && gh_pair_p (a); a = ly_cdr (a))
+    b = b || sym == ly_car (a);
 
   return b;
 }
@@ -150,3 +149,4 @@ Translator::static_translator_description ()const
 IMPLEMENT_SMOBS (Translator);
 IMPLEMENT_DEFAULT_EQUAL_P (Translator);
 IMPLEMENT_TYPE_P(Translator,"ly:translator?");
+
index 5ab7062c3d1738160027fc93df20cfd1c5248873..0f4d2c1901854e3dc2406dfafc8e0bcb684fdf6c 100644 (file)
@@ -81,11 +81,11 @@ newpage = \notes
 }
 
 % dynamic ly:dir?  text script, articulation script ly:dir?    
-oneVoice = #(context-spec-music (make-voice-props-revert) "Voice")
-voiceOne = #(context-spec-music (make-voice-props-set 0) "Voice")
-voiceTwo = #(context-spec-music (make-voice-props-set 1) "Voice")
-voiceThree =#(context-spec-music (make-voice-props-set 2) "Voice")
-voiceFour = #(context-spec-music (make-voice-props-set 3) "Voice")
+oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
+voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
+voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
+voiceThree =#(context-spec-music (make-voice-props-set 2) 'Voice)
+voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice)
 
        
 tiny  = 
index 5b146f580d8aa2047315065239d95cef13953ff2..e705f24b59e9de52c63bc2f1686cf6e107e06864 100644 (file)
@@ -35,10 +35,10 @@ TODO: consider making type into symbol ")
 (music-property-description 'bass boolean? "Set if this note is a bass note in a chord")
 (music-property-description 'cautionary boolean? "If set, this alteration needs cautionary accidental")
 (music-property-description 'change-to-id string? "name of the context to change to ")
-(music-property-description 'change-to-type string? "type of the context to change to.")
+(music-property-description 'change-to-type symbol? "type of the context to change to.")
 (music-property-description 'compress-procedure procedure? "compress this music expression. Argument 1: the music, arg 2: factor")
 (music-property-description 'context-id string? "name of context")
-(music-property-description 'context-type string?  "type of context")
+(music-property-description 'context-type symbol?  "type of context")
 (music-property-description 'denominator integer? "denominator in a time signature")
 (music-property-description 'digit integer? "digit for fingering")
 (music-property-description 'direction ly:dir? "Print this up or down?")
@@ -83,7 +83,7 @@ starting grace notes.")
 (music-property-description 'tremolo-type integer? "")
 (music-property-description 'value scheme? "Assignment value for a
 translation property")
-(music-property-description 'what string? "What to change for auto-change. FIXME, naming")
+(music-property-description 'what symbol? "What to change for auto-change. FIXME, naming")
 
 (music-property-description 'figure string? "a `figure' (which may be
 a string) for figured bass")
index 90a0cef020c1a2d05eb1b0e0647e9d6b37e5dfe9..b6beb241b52eeb99868131e5033031a5a2421fb1 100644 (file)
  )
 
 (define (make-head-type t)
-  (context-spec-music (make-head-type-elem t) "Thread"))
+  (context-spec-music (make-head-type-elem t) 'Thread))
 
 (define (make-thread-context thread-name element)
-  (context-spec-music element "Thread" thread-name))
+  (context-spec-music element 'Thread thread-name))
 
 ;; makes a sequential-music of thread-context, head-change and note
 (define (make-drum-head kit req-ch )
index 73a398cffef6557205292782d99557d393974a0c..431b9bdc30b12d8b087763bcdfb175acd2d43b8c 100644 (file)
@@ -354,7 +354,7 @@ and set OTTAVATION to `8va', or whatever appropriate."
              ))))
 
   (ly:set-mus-property! m 'procedure  ottava-modify)
-  (context-spec-music m "Staff")
+  (context-spec-music m 'Staff)
   ))
 
 (define-public (set-octavation ottavation)
@@ -379,7 +379,7 @@ Rest can contain a list of beat groupings
        (basic  (list set1 set2 set3 set4)))
 
     (context-spec-music
-     (make-sequential-music basic) "Timing")))
+     (make-sequential-music basic) 'Timing)))
 
 (define-public (set-time-signature num den . rest)
   (ly:export (apply make-time-signature-set `(,num ,den . ,rest))))
@@ -446,7 +446,7 @@ Rest can contain a list of beat groupings
                (make-voice-props-set number)
                (make-simultaneous-music (car lst))))
 
-             "Voice"  (number->string number))
+             'Voice  (number->string number))
              (voicify-list (cdr lst) (+ number 1))
        ))
    )
@@ -612,7 +612,7 @@ Rest can contain a list of beat groupings
         )
       (ly:set-context-property! where 'graceSettings new-settings)))
     
-    (ly:export (context-spec-music (make-apply-context set-prop) "Voice")))
+    (ly:export (context-spec-music (make-apply-context set-prop) 'Voice)))
 
 
 (define-public (set-start-grace-properties context)
index 2f14ad226d277779143f76b22d13502271169bb1..7e9c2d78fa6a002ae6a30bc12a2c1b2340e522fc 100644 (file)
@@ -1444,6 +1444,11 @@ if 1:
        def conv (str):
                str = re.sub ('accacciatura',
                              'acciaccatura', str)
+
+               if re.search ("context-spec-music"):
+                       sys.stderr.write ("context-spec-music takes a symbol for the context now. Update by hand."
+                       raise FatalConversionError()
+
                return str
        
        conversions.append (((1,9,3), conv, """\acciaccatura misspelling"""))
index 22c65e2e72e845c9d18bf5181784cad06e8318ba..04d278a65e363b015ed3ff75d9beceb4a746bcd1 100644 (file)
@@ -1,6 +1,6 @@
 #!@PYTHON@
 #
-# ly2dvi.py -- Run LilyPond, add titles to bare score, generate printable
+# lilypond.py -- Run LilyPond, add titles to bare score, generate printable
 #              document
 #              Invokes: lilypond, latex (or pdflatex), dvips, ps2pdf, gs
 # 
@@ -9,7 +9,7 @@
 # (c)  1998--2003  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #                 Jan Nieuwenhuizen <janneke@gnu.org>
 
-# This is the third incarnation of ly2dvi.
+# This is the third incarnation of ly2dvi, now renamed lilypond.
 #
 # Earlier incarnations of ly2dvi were written by
 # Jeffrey B. Reed<daboys@austin.rr.com> (Python version)
@@ -24,7 +24,7 @@
 '''
 TODO:
 
-  * figure out which set of command line options should make ly2dvi:
+  * figure out which set of command line options should make lilypond:
 
       na: create tex only?  
       na: create latex only? 
@@ -37,8 +37,6 @@ TODO:
 
      etc.
 
-  * for foo.ly, rename ly2dvi.dir to out-ly2dvi, foo.ly2dvi, foo.dir ?
-     
   * move versatile taglines, 
   
      \header {
@@ -106,7 +104,7 @@ global _;_=ly._
 global re;re = ly.re
 
 # lilylib globals
-program_name = 'ly2dvi'
+program_name = 'lilypond'
 program_version = '@TOPLEVEL_VERSION@'
 verbose_p = 0
 pseudo_filter_p = 0