Folks,

Just a random thought in passing: I just wrote something of this kind once again:

(let ((elements (ly:music-property m 'elements))
      (element (ly:music-property m 'element))
      (articulations (ly:music-property m 'articulations)))
  ...)

(let ((padding (assoc-ref details 'padding))
      (common-Y (assoc-ref details 'common-Y)))
  ...)

(let ((padding (ly:grob-property grob 'padding)
      (shorten-pair (ly:grob-property grob 'shorten-pair))
      (normalized-endpoints (ly:grob-property grob 'normalized-endpoints)))
  ...)


Does anyone find a value in defining a macro for this?


\version "2.23.8"

#(define-syntax-rule (fetch obj getter (sym ...) body body* ...)
   (let ((evald-obj obj)
         (evald-getter getter))
     (let ((sym (getter obj 'sym))
           ...)
       body body* ...)))
{
  c'1
  \tweak after-line-breaking
    #(lambda (grob)
       (fetch grob ly:grob-property (left-bound-info)
         (fetch left-bound-info assoc-ref (common-Y X padding attach-dir)
           (ly:message "common-Y=~a X=~a padding=~a attach-dir=~a" common-Y X padding attach-dir))))
  \startTextSpan
  c'1\stopTextSpan
}


Jean

Reply via email to