lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Procedure for set-paper-size in \paper ?


From: Thomas Morley
Subject: Procedure for set-paper-size in \paper ?
Date: Fri, 18 May 2018 23:24:24 +0200

Hi all,

(1)
consider the following code (working as expected):

\paper {
  #(if #t (set-paper-size "a8" 'landscape) #(set-paper-size "a8"))
}

\score { { R1 } \layout { ragged-right = ##f } }

Switching from #t to #f results in different paper-size, as desired.

(2)
But trying to put it in a procedure, it always returns the true-case:

#(define (proc bool x y)
  (if bool x y))

\paper {
  #(proc #f (set-paper-size "a8" 'landscape) #(set-paper-size "a8"))
}

\score { { R1 } \layout { ragged-right = ##f } }

Paper-size is always a8-landscape.

(3)
Trying:
#(define (proc bool x y)
  (if bool x y))

\paper {
  #(apply set-paper-size (proc #t '("a8" 'landscape) '("a8")))
}

\score { { R1 } \layout { ragged-right = ##f } }

Paper-size is always a8

---------

What's happening here and why?
And how to make a procedure accepting set-paper-size work, with
different settings and an if-condition?

Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]