David Kastrup <[email protected]> writes:

> Davide Liessi <[email protected]> writes:
>
>> Il giorno mer 14 nov 2018 alle ore 08:25 Keizen Li Qian
>> <[email protected]> ha scritto:
>>> Parsing.../usr/share/lilypond/2.18.2/ly/music-functions-init.ly:564:11:
>>> In procedure ly:music-transpose in expression (ly:music-transpose
>>> (make-music # # ...) tonic):
>>> /usr/share/lilypond/2.18.2/ly/music-functions-init.ly:564:11: Wrong
>>> type (expecting pair): major
>>
>> You probably wrote
>> \key c major
>> instead of
>> \key c \major
>
> Well spotted.  The embarrassing thing is that we even get there: this
> is something that should rather be caught earlier.  We have
>
> key =
> #(define-music-function (tonic pitch-alist)
>    ((ly:pitch? '()) (list? '()))
> [...]
>
> and the word major qualifies as list? by getting converted to '(major)
> which is a symbol list like needed for some override/tweak
> specifications.
>
> So it very much looks like we should use a more specific predicate than
> list? for the scale type in order to not have that user error pass down
> in this manner.
>
> Suggestions?

Well, I can bump that rather easily (using existing predicates) to


gag.ly:2:10: error: wrong type for argument 2.  Expecting list of number pairs, 
found "major"
  \key c 
         major

This is probably at best slightly less obscure to the beginner but at
least flags the right place and element in the input.  To give a nicer
message, one would need a specific predicate for scales.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to