lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] functional-or returned #f for (functional-or #f #t #f). Fixe


From: David Kastrup
Subject: Re: [PATCH] functional-or returned #f for (functional-or #f #t #f). Fixed.
Date: Mon, 16 Nov 2009 09:19:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Patrick McCarty <address@hidden> writes:

> Thanks, pushed.

Thanks.  The only caller (this is apparently in local namespace) as far
as I can see is

(define-public (fret-number-tablature-format string context event)
  (let* ((tuning (ly:context-property context 'stringTunings))
         (pitch (ly:event-property event 'pitch))
         (is-harmonic (apply
                       functional-or
                       (map
                        (lambda (ev)
                          (eq? 'harmonic-event (ly:event-property ev 'class)))
                        (ly:event-property event 'articulations)))))

And that would likely be better written as

(is-harmonic (memq 'harmonic-event
               (map (lambda (ev) (ly:event-property ev 'class))
                    (ly:event-property event 'articulations)))

It still suffers from not doing short-circuit evaluation.  For
readability and efficiency, I'd really prefer replacing
'(apply functional-or' with '(any'      

-- 
David Kastrup





reply via email to

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