Mark Knoop <m...@opus11.net> writes:

> On upgrading to 2.19.32, one of my regular functions no longer works.
> It seems that a single number as the first argument is now accepted as a
> number-list whereas before it was not and thus became the second
> argument.
>
> Whilst the new possibility to write lists as 1,2,3,4 is very nice, is
> there any way to alter my function definition to achieve the old
> behaviour?
>
> myFunction = #(define-void-function
>   (a b c d)
>   ((number-list? '()) number? (boolean? #t) fraction?)
>   (print "\na=~s b=~s c=~s d=~s\n" a b c d))
>
> {
>   % this works when all arguments are specified
>   \myFunction 1,2,3,4 4 ##t 4/4
>   % not specifying first argument no longer works
>   \myFunction 4 4/4
> }

You can write your own predicate that will reject lists containing a
single number.  But it will then also reject an explicit #'(3).  I'm
afraid that you just created an interface that was too delicate to
survive further development.

Of course, you can always skip an optional argument using \default, but
that's likely not what you would want to do.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to