lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lily-guile updates and CG: "Scheme->C interface" section. (issue 491


From: n . puttock
Subject: Re: lily-guile updates and CG: "Scheme->C interface" section. (issue 4917044)
Date: Fri, 19 Aug 2011 20:20:12 +0000


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/



reply via email to

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