lilypond-devel
[Top][All Lists]
Advanced

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

Limiting the number of accepted contexts


From: Dan Eble
Subject: Limiting the number of accepted contexts
Date: Thu, 12 Jul 2018 09:02:49 -0400

I am considering allowing context definitions to express that no more than one 
of a certain child is accepted.  This is the currently implicitly the case for 
Score as a child of Global.

I thought a syntax something like this would work:

        \accepts “Zinnia”  % any number of Zinnias is accepted
        \accepts 1 “Peony” % at most one Peony is accepted

A user asking specifically for a \new Peony when one already exists gets a 
warning.

If a Peony is required as an intermediate context when creating a new 
descendant, and the Peony already exists, it is used silently.  This grace 
would not extend to limits > 1.

I would expect the initial implementation to reject any limit > 1.  Allowing 
larger numbers is an obvious direction for extension, but I don’t know whether 
there is a use case for it.

I’m not sure yet that I want to go through with this just to eliminate a small 
amount of special code for Global/Score, but I’m warming up to it.  If there 
are related concerns you would like me to consider, please voice them.

Regards,
— 
Dan




reply via email to

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