Shevek <s...@saultobin.com> writes: > I just finished writing my first Scheme extension for Lilypond! It is a > function to take a sequential music expression and condense consecutive > multimeasure rests into a single multimeasure rest. Since this is my first > attempt at Scheme, I'd love suggestions on how to improve it. One thing I'd > like is to make this something that can be turned on with a single line in a > layout block, instead of a function that needs to be included with every > staff or voice. > > % \version "2.14.2" > \version "2.16.0" > > #(define (add-durations dur1 dur2) (ly:duration? ly:duration?)
It is amusing that this works. define does not take type specifications for its arguments, as opposed to define-music-function and define-scheme-function. What happens is that (ly:duration? ly:duration?) is called as the first statement in the function. It checks whether ly:duration? is a duration and returns #f since it is actually a function instead. You do this several times. I'll look at the rest later. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user