Hi Aaron
Thanks. That's very helpful. It looks like from your example you linked to that there's probably a way to do just about anything in lilypond with Scheme, and I just need to dive into the scm library files. The other part is just learning how Scheme is different from Clojure (which is currently the only lisp I'm familiar with).
Re: arity, the (admittedly unclear) question wasn't whether or not scheme supports multi-arity, but whether you can "splat" any list (doesn't have to be from args), into a block of lilypond code, i.e.,
%%%
\version 2.20.0
foo = #(lambda the_rest #{
\bookpart {
\score_one
\score_two
#the_rest % <= splat: assuming `the_rest` is a list of scores
}
#})
%%%%
The above doesn't work for reasons other than the lambda's arity, and for something like the above case, it looks like I'm probably better off using some procedures form the scm library like `add-score` or something lower level making use of `ly:parser-lookup` such as is done here:
```lily-library.scm
(define-public (add-score score)
(cond
((ly:parser-lookup '$current-bookpart)
((ly:parser-lookup 'bookpart-score-handler)
(ly:parser-lookup '$current-bookpart) score))
((ly:parser-lookup '$current-book)
((ly:parser-lookup 'book-score-handler)
(ly:parser-lookup '$current-book) score))
(else
((ly:parser-lookup 'toplevel-score-handler) score))))
```
But the question of whether you can apply a given list as arguments to a lilypond directive like I'm exemplifying with "the_rest" above -- still unclear about what is allowed in terms of interop with Scheme in these blocks. Does that question make sense? That's why I brought up macros, because in a general sense they make it possible to do (in Clojure, anyway) "unquote-splicing", obviating using something like `apply`, etc. But since you're in a lilypond block, it's just not clear to me what is allowed there in terms of interpolating scheme values.
Thanks again
Tom