Hallo all

I'm having unexpected problems with a music function.
It takes several arguments, the first of which expects a list,
and should be optional.

Today it tripped up when run with a late 2.19 version and I narrowed this down to 2.19.39. It seemed to have trouble with the second parameter so I set up test cases where this varied, expecting a mixture of good and bad. But instead I got a confusing mixture of bad and bad, including a 2.18.2 failure. See listargtest.ly.


The music function chordRepeats has a similar first argument for event-types but that hasn't helped me see what I am doing wrong.
I suppose it's me or my computer that's wonky, so I would be glad of
a fresh eye or a second opinion.


Cheers,
Robin
liststring = 
#(define-music-function (parser location listarg stringarg) 
((list? '()) string?) 
(let ((str stringarg))
#{ 
  c''1-\markup $str
#}))


listnumber = 
#(define-music-function (parser location listarg numberarg) 
((list? '()) number?) 
(let ((str (number->string numberarg)))
#{ 
  c''1-\markup $str
#}
))


{
  s1_"empty listarg supplied:"                            \break
  s1_"\liststring #'() \"aaa\"" \liststring #'() "aaa" s1 \break
  s1_"\listnumber #'() 111"     \listnumber #'() 111 s1   \break
}
{
  s1_"listarg not supplied:"                              \break
  s1_"\liststring \"bbb\""      \liststring "bbb" s1      \break % 2.16.2 ok   2.18.2 nok
  s1_"\liststring \"222\""      \liststring "222" s1      \break % 2.19.39 ok  2.19.80 nok
  s1_"\listnumber 333"          \listnumber 333 s1        \break % 2.19.38 ok  2.19.39 nok
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to