Le 16/01/2023 à 15:12, | || | | a écrit :
So I thought about delete one nested (list) and try it:

nd =  #(define-music-function (number) (integer?)
          (make-music
          'TimeSignatureMusic
          'numerator
          8
          'denominator
          8
          'beat-structure
          '())
        (make-music
          'UnfoldedRepeatedMusic
          'elements
          '()
          'repeat-count
          8
          'element
          (make-music
            'SequentialMusic
            'elements
            (list (make-music
                    'SkipEvent
                    'duration
                    (ly:make-duration 3))))))


But the problem is, when I don't use (list) for two adjacent (make-music) functions, one of them doesn't run, so depending on the kind of second (make-music) code, one od them goes, another don't.




David already explained the missing 'origin. I just want to explain
why this drops the first expression: it has nothing to do with LilyPond,
it's just the way Scheme works. When you have a sequence of expressions
like this in the body of a function, they are evaluated in turn, and
the value of the last one is returned. The others are discarded. They
can only be useful if they have "side effects", like (display ...)
for example.

Best,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to