[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making a list argument reliably optional
From: |
Robin Bannister |
Subject: |
Re: Making a list argument reliably optional |
Date: |
Sun, 25 Aug 2019 22:29:27 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
David Kastrup wrote:
A number list counts as not-number?.
So I changed the not- number? predicate to also exclude number-list? but
this was no better. And then I determined all the individually
problematic lilypond-scheme-predicates and also excluded these in the
predicate never-matches-a-number? - which nevertheless matched a number.
That was when I gave up fighting the automagic.
> So if you are out for a more specific type of list before a number,
> you should check for that.
I was using what might be described as a sparse ordered list, basically
markup-list? but having its gaps filled with rogue elements, for which I
used a (non-markup) asterisk.
Following your advice, I got this working in stellated_ok.ly.
But this seemed overly complicated:
- the predicate definition had to be separate (AFAICS)
- the list had to be set up in Scheme.
That was when I decided to embrace automagic.
The rogue elements are now markup too, matched with the help of
markup->string:
- the predicate is just markup-list?
- the list can be set up with \markuplist.
The in-band key is unlikely to be a problem.
Thanks for your help.
Cheers,
Robin
stellated_ok.ly
Description: Text Data