From: [email protected] 
<[email protected]> on behalf of K. Blum 
<[email protected]>
Date: Monday, July 8, 2024 at 2:40 PM
To: [email protected] <[email protected]>, [email protected] 
<[email protected]>
Subject: scheme: formula instead of value
Dear LilyPonders,

in an \override statement, I want to use the result of a mathematical 
computation instead of a simple value:

% ------------------
\version "2.24.3"
\markup {
   % \override #'(baseline-skip . 2)   % works
   \override #'(baseline-skip . (* 0.5 4.0))   % does not work
   \column { 1 2 3 }
}
% ------------------

This causes an error:
Fehler: Guile signaled an error for the expression beginning here
#
  (let ((book-handler (if (defined? 'default-toplevel-book-handler)
In procedure ly:stencil-stack: Wrong type argument in position 6 (expecting 
number): (* 0.5 4.0)

Is this really impossible or am I missing something?

Because your list is quoted, the calculation isn’t done.
Try
\override #`(baseline-skip . ,(* 0.5 4.0))
Or
\override #(cons ‘baseline-skip (* 0.5 4.0))


Cheers,
Klaus

Reply via email to