line-pos) <))
(gap-to-find (/ (+ dot-y-length line-thickness)
(/ staff-space 2)))
- (first (car folded-staff))
- (found #f))
+ (first (car folded-staff)))
;; find the first space big enough
;; to hold a dot and a staff line
;; (a space in the folded staff may be
;; narrower but can't be wider than the
;; corresponding original spaces)
- (reduce (lambda (x y) (if (and (> (- x y) gap-to-find)
- (not found))
- (begin
- (set! found #t)
- (set! dist (+ x y))))
- x)
- ""
- folded-staff)
-
- (if (not found)
- (set! dist (if (< gap-to-find first)
- ;; there's a central space big
- ;; enough to hold both dots
- first
-
- ;; dots should go outside
- (+ (* 2 (car
- (reverse folded-staff)))
- (/ (* 4 dot-y-length)
- staff-space))))))))))))
+ (set! dist
+ (or
+ (any (lambda (x y)
+ (and (> (- y x) gap-to-find)
+ (+ x y)))
+ folded-staff (cdr folded-staff))
+ (if (< gap-to-find first)
+ ;; there's a central space big
+ ;; enough to hold both dots
+ first
+
+ ;; dots should go outside
+ (+ (* 2 (last folded-staff))
+ (/ (* 4 dot-y-length)
+ staff-space))))))))))))
(set! staff-space 1.0))
(let* ((stencil empty-stencil)
(= 7 (pitch-step main-name))
(is-natural-alteration? main-name)
(pair? (remove-uptil-step 7 alterations))
- (reduce (lambda (x y) (and x y)) #t
- (map is-natural-alteration? alterations)))
+ (every is-natural-alteration? alterations))
(begin
(set! main-name (last alterations))
(set! alterations '())))
"Returns true if x is the square of a value in input-list."
(pair? (memv (inexact->exact (sqrt x)) input-list)))
-(define (satisfies-function? function input-list)
- "Returns true if an element in @code{input-list} is true
- when @code{function} is applied to it.
- For example:
- @code{guile> (satisfies-function? null? '((1 2) ()))}
- @code{#t}
- @code{guile> (satisfies-function? null? '((1 2) (3)))}
- @code{#f}"
- (if (null? input-list)
- #f
- (or (function (car input-list))
- (satisfies-function? function (cdr input-list)))))
-
(define (true-entry? input-list)
"Is there a true entry in @code{input-list}?"
- (satisfies-function? identity input-list))
+ (any identity input-list))
(define (entry-greater-than-x? input-list x)
"Is there an entry greater than @code{x} in @code{input-list}?"
- (satisfies-function? (lambda (y) (> y x)) input-list))
+ (any (lambda (y) (> y x)) input-list))
(define (n-true-entries input-list)
"Returns number of true entries in @code{input-list}."
- (reduce + 0 (map (lambda (x) (if x 1 0)) input-list)))
+ (count identity input-list))
(define (bezier-head-for-stencil bezier cut-point)
"Prepares a split-bezier to be used in a connected path stencil."
(if (ly:music? e)
(set! (ly:music-property m 'element) (voicify-music e)))
(if (and (equal? (ly:music-property m 'name) 'SimultaneousMusic)
- (reduce (lambda (x y ) (or x y)) #f (map music-separator? es)))
+ (any music-separator? es))
(set! m (context-spec-music (voicify-chord m) 'Staff)))
m))
(define (close-enough fret)
"Decide if @var{fret} is acceptable, given the already used frets."
- (if (null? specified-frets)
- #t
- (reduce
- (lambda (x y)
- (and x y))
- #t
- (map (lambda (specced-fret)
- (or (zero? specced-fret)
- (zero? fret)
- (>= maximum-stretch (abs (- fret specced-fret)))))
- specified-frets))))
+ (every (lambda (specced-fret)
+ (or (zero? specced-fret)
+ (zero? fret)
+ (>= maximum-stretch (abs (- fret specced-fret)))))
+ specified-frets))
(define (string-qualifies string pitch)
"Can @var{pitch} be played on @var{string}, given already placed