[Top][All Lists]

[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: Patrick McCarty
Subject: Re: [PATCH] functional-or returned #f for (functional-or #f #t #f). Fixed.
Date: Tue, 17 Nov 2009 17:16:26 -0800
User-agent: Mutt/1.5.20 (2009-06-14)

On 2009-11-16, David Kastrup wrote:
> 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'      

It looks like Neil removed the "is-harmonic" binding from this
procedure a couple of days ago, since it was unused.

So, nothing really needs to be changed after all.  :-)


reply via email to

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