Dan Eble <d...@faithful.be> writes:

> On Aug 29, 2020, at 14:52, David Kastrup <d...@gnu.org> wrote:
>> 
>> My own take on it is that \alternative syntax is an abomination and it
>> should likely be more like
>> 
>> \repeat volta 40 {
>>  ...
>>  \alternative { ... }
>>  \alternative { ... }
>>  \alternative { ... }
>> }
>> 
>> since that would avoid several syntactical problems and would allow to
>> produce alternatives by music functions.
>
> I agree, but that's a little too far into fantasy land for me to attempt 
> right now.  The other stuff proposed so far seems more attainable.
>
> I've been intending to ask you how difficult you think it would be to
> make the parser treat \alternative as a music function whenever it
> does not follow a \repeat {}?

I don't think that makes sense.  I'd just remove \alternative as a
reserved word from the parser altogether, give it a music type
representation, and then let some cleanup function put the bits
together (if equivalence in music expressions is wanted, but I am not
sure of that actually).

> I've gotten \alternative << >> working to my satisfaction, but I did
> it by requiring the << >> in the parser.  I think it would be nicer if
> something like
>
>     \repeat volta 2 {
>       ...notes...
>       \alternative M
>       ...notes...
>     }
>
> would call a music function with argument M.

Sure, that should be feasible with an optional argument of type
index-list? or similar.

-- 
David Kastrup

Reply via email to