I didn't know about \default or the dot/comma separated number/symbol lists! I can see those being useful in some circumstances. I was thinking about cases where an undefined amount of things different than symbols or numbers are required, and the closest I can imagine is chaining functions to create the illusion of a variable amount of arguments, like this:
\version "2.19.80"
#(define (end-list? obj)
(and (list? obj)
(let ((item (last obj)))
(and (symbol? item)
(equal? "end" (symbol->string item))))))
end = #(list 'end)
#(define (el->curated-el el)
(delete 'end el))
untilEnd =
#(define-void-function (proc el) (procedure? end-list?)
(let ((curated-el (el->curated-el el)))
(for-each
(lambda (elem)
(proc elem))
curated-el)))
selfAppending =
#(define-scheme-function (e-l) (end-list?)
(let ((self-input (list (cons 1 2) (cons 3 4))))
(append self-input e-l)))
selfAppendingInput =
#(define-scheme-function (input e-l) (scheme? end-list?)
(append (list input) e-l))
\relative c'' {
c d e f
\untilEnd #pretty-print
\selfAppending
\selfAppendingInput #'(some useful input?)
\selfAppendingInput #selfAppending
\selfAppending
\end
g a b c
}
This structure just happens to work for something I'm trying now but I can see it being too narrow in general.
@Urs, I not familiar with \with blocks, I'll take a look at the oll-core code and experiment a bit with it. Maybe I'll be able to help.