The difference is that \new internally generates a unique new
name to the context, thus making sure that you really get a new
context. If you use \context, then you must make up a new unique
name yourself, if you want to get a new context and not just
another invocation of some existing context.

It wouldn't make sense to let a user specify a context name
with \new, since then there is no longer any guarantee that
the context really is new, right? Also, if you want to name a
context, then you should use \context.

  /Mats

Graham Percival wrote:

Why do we have \context and \new ? I know that \context lets you name a context and \new doesn't... but is that the only difference? ... actually, you can use \context to do fancy stuff with already-existing contexts, right?

Could we change \new so that it can also name a new context? I'm looking at the vocal templates, having:
\score {
  \new Staff { \violinmelody }
  \context Staff =singer {
    \context Voice = vocal { \blah }
  \new PianoStaff {...}
}

The alternating \new and \context seems confusing. It would be nice if we could do
  \new Staff { \violinmelody }
  \new Staff = singer {
    \new Voice = vocal { \blah }
  \new PianoStaff {...}

Cheers,
- Graham



_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel



--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: [EMAIL PROTECTED]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to