[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: More nuanced BarLine extra-spacing-height to allow tighter horizonta
From: |
dak |
Subject: |
Re: More nuanced BarLine extra-spacing-height to allow tighter horizontal spacing (issue 5434104) |
Date: |
Mon, 05 Dec 2011 07:52:44 +0000 |
http://codereview.appspot.com/5434104/diff/1/scm/output-lib.scm
File scm/output-lib.scm (right):
http://codereview.appspot.com/5434104/diff/1/scm/output-lib.scm#newcode408
scm/output-lib.scm:408: (define-public
(pure-from-neighbor-interface::account-for-span-bar grob)
On 2011/12/05 06:00:05, Keith wrote:
Golly gee! Is this how you have to loop over a pair in this language?
Scheme
must be for losers. I'm glad I use more powerful languages like
FORTRAN77.
IF .NOT.has-span-bar(UP)
esh(UP) = min(esh(UP), 1.01)
ENDIF
IF .NOT.( has-span-bar(DOWN).AND.allow-span-bar )
esh(DOWN)= max(esh(DOWN), -1.01)
ENDIF
No, this is just Mike's entry for the obfuscated programming contest.
This actually is just
(define-public (pure-from-neighbor-interface::account-for-span-bar grob)
(let* ((esh (pure-from-neighbor-interface::extra-spacing-height grob))
(hsb (ly:grob-property grob 'has-span-bar))
(ii (interval-intersection esh (cons -1.01 1.01)))
(if (pair? hsb)
(cons (car (if (and (cdr hsb)
(ly:grob-property grob 'allow-span-bar))
esh ii))
(cdr (if (car hsb) esh ii)))
ii))))
Putting a loop here is plain insanity since it contains just two
iterations, and with quite different code in them.
http://codereview.appspot.com/5434104/