[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pitch alterations use SCM rather than flower rationals (issue 106190
Re: Pitch alterations use SCM rather than flower rationals (issue 106190043 by address@hidden)
Fri, 27 Jun 2014 04:06:40 +0000
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
- Re: Pitch alterations use SCM rather than flower rationals (issue 106190043 by address@hidden),