[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with /accepts
From: |
Thomas Morley |
Subject: |
Re: Problem with /accepts |
Date: |
Tue, 18 Apr 2017 14:14:25 +0200 |
2017-04-18 10:55 GMT+02:00 David Kastrup <address@hidden>:
> Thomas Morley <address@hidden> writes:
>
>> 2017-04-17 21:08 GMT+02:00 Roman Stawski <address@hidden>:
>>> Hello all
>>>
>>>
>>> I'm coming across a problem with context definitions:
>>>
>>> \layout {
>>> \context {
>>> \name P
>>> \alias Voice
>>> }
>>>
>>> This blows up with the error
>>>
>>> Interpreting music...ERROR: In procedure symbol->string:
>>> ERROR: Wrong type argument in position 1 (expecting symbol): ()
>>> Exited with return code 1.
>>>
>>> If I comment out the '\accepts' compilation finishes, (but ignores the
>>> context P obviously).
>>
>> From: NR 5.1.6 Defining new contexts
>>
>> "The mechanisms with which contexts communicate are established by declaring
>> the context \type. Within a \layout block, most contexts will be of type
>> Engraver_group.
>> [...]
>> Copying and modifying an existing context definition will also fill in
>> the type."
>>
>>
>> So (see comments):
>>
>>
>> \layout {
>> %% define "P" from scratch
>> \context {
>> \type "Engraver_group"
>> \name P
>> \alias Voice
>> %% put in engravers for what you want
>> %% otherwise no output
>> }
>
> Trigger and wording of error message are not overly helpful here. This
> should likely be caught at an earlier point of time.
>
> --
> David Kastrup
Out of curiosity, could you point me to where the current error is triggered?
I've added some debugging code:
(define (print-book-with parser book process-procedure)
(let* ((paper (ly:parser-lookup parser '$defaultpaper))
(layout (ly:parser-lookup parser '$defaultlayout))
(outfile-name (get-outfile-name parser book)))
(pretty-print
(list
book
paper
(map
(lambda (sym)
(cons
(ly:context-def-lookup
(assoc-get 'P (ly:module->alist
(ly:output-def-scope layout)))
sym)
sym))
(list
'default-child
'consists
'description
'aliases
'accepts
'property-ops
'context-name
'group-type))
(assoc-get 'P (ly:module->alist (ly:output-def-scope layout)))
outfile-name))
(process-procedure
book
paper
layout
outfile-name)))
returning:
(#<Book>
#< Output_def>
((() . default-child)
(() . consists)
(() . description)
((Voice) . aliases)
(() . accepts)
(() . property-ops)
(P . context-name)
(() . group-type))
#<Context_def P atest-55.ly:636:5>
"atest-55")
Though, I don't see symbol->string applied anywhere there.
Cheers,
Harm