[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \context foo = "bar" vs. \new foo

From: Mats Bengtsson
Subject: Re: \context foo = "bar" vs. \new foo
Date: Fri, 10 Feb 2006 20:02:44 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3

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.


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 {...}

- Graham

lilypond-devel mailing list

        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Phone: (+46) 8 790 8463                         
       Fax:   (+46) 8 790 7260
        Email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]