http://codereview.appspot.com/4917044/diff/1/lily/general-scheme.cc File lily/general-scheme.cc (right):
http://codereview.appspot.com/4917044/diff/1/lily/general-scheme.cc#newcode110 lily/general-scheme.cc:110: if (scm_is_integer (s)) On 2011/08/19 18:04:38, Carl wrote:
I think the old code here is correct, and the doc-string is wrong.
Both are correct; the only difference is when Guile raises an error. In Bertrand's version, it's at the top of the code; in current master, it's in the block below when scm_to_int () is called. http://codereview.appspot.com/4917044/diff/1/lily/include/lily-guile.hh File lily/include/lily-guile.hh (right): http://codereview.appspot.com/4917044/diff/1/lily/include/lily-guile.hh#newcode96 lily/include/lily-guile.hh:96: // or scm_is_true (scm_exact_p (x)) ? Have you looked at the definition in the Guile repository (libguile/numbers.h)? It's a low-level function which returns true if the SCM object isn't an immediate (http://www.gnu.org/software/guile/manual/guile.html#Immediate-objects) and is tagged as a fraction (I think this only happens if scm_divide () creates a fraction) http://codereview.appspot.com/4917044/diff/1/lily/lily-guile.cc File lily/lily-guile.cc (right): http://codereview.appspot.com/4917044/diff/1/lily/lily-guile.cc#newcode229 lily/lily-guile.cc:229: return is_number_pair (p) ? ly_scm2interval is deliberately sloppy; it's assumed the caller has made sure the object is a number pair. If we're unsure, we use robust_scm2interval, which does the check then calls this function to perform the conversion. Adding this extra safety check will cause any robust_scm2interval call on a valid number-pair to get two checks. http://codereview.appspot.com/4917044/diff/1/lily/lily-guile.cc#newcode290 lily/lily-guile.cc:290: return is_number_pair (s) ? see comment for ly_scm2interval http://codereview.appspot.com/4917044/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel