Using Guile rationals is good on principle, but it's not great for readability. It makes arithmetic and comparisons much more verbose, and type declarations less informative. This isn't much of a problem for pitch alterations (since it's balanced by the reduced hassle of converting between the two representations), but it would be if all of Lilypond's rational arithmetic were converted to Guile rationals. Is there a way to make this less awkward?
We can't just overload the arithmetic and comparison operators to work on Scheme numbers, because SCM is a pointer type so it already has them. Rational could become a wrapper around a Guile rational, but that's not much simpler than the status quo. Convenience functions for things like scm_is_true(scm_less_p(...)) would make comparisons a little less verbose (and reduce the risk of forgetting scm_is_true). https://codereview.appspot.com/106190043/ _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
