Valentin Villenave <valen...@villenave.net> writes: > On Thu, Apr 7, 2011 at 9:27 AM, David Kastrup <d...@gnu.org> wrote: >> @@ -910,12 +908,10 @@ then revert skipTypesetting." >> (let* >> ((show-last (ly:parser-lookup parser 'showLastLength)) >> (show-first (ly:parser-lookup parser 'showFirstLength)) >> - (show-last-length (if (ly:music? show-last) >> - (ly:music-length show-last) >> - #f)) >> - (show-first-length (if (ly:music? show-first) >> - (ly:music-length show-first) >> - #f)) >> + (show-last-length (and (ly:music? show-last) >> + (ly:music-length show-last))) >> + (show-first-length (and (ly:music? show-first) >> + (ly:music-length show-first))) >> (orig-length (ly:music-length music))) > > This one's on me. Nice catch!
Not as bad as several (if (not (equal? whatever #f)) ...) I have seen (there does not appear to be any system behind people picking equal? or eq?), but I find it confusing to track complex conditionals just to figure out how a boolean is interpreted. In particular when some things get long, like in (if condition twenty-line-long-sexp #f) and you have to hunt for the lone #f at the end of the maze. I am tempted to just push this one: I checked it reasonably carefully. There is just one comparison with #t I simplified (something like (equal? x #t) => x), and the term in question is set in the same definition and can only be #t or #f. Simplifying comparisons with #f, in contrast, should not require cross-checking as long as the result is used as a condition right away. -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel