Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(231)

Unified Diff: lily/lily-guile.cc

Issue 4917044: lily-guile updates and CG: "Scheme->C interface" section.
Patch Set: Typo again. Created 12 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lily/lily-guile.cc
diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc
index ff3f7064bf62d4666d8cc4c8193ea6b2cc8b33af..aecc658ebb263ed1f0fa15f6ec7164f2e4cd9eea 100644
--- a/lily/lily-guile.cc
+++ b/lily/lily-guile.cc
@@ -178,7 +178,7 @@ ly_scm_hash (SCM s)
bool
is_axis (SCM s)
{
- if (scm_is_number (s))
+ if (scm_is_integer (s))
{
int i = scm_to_int (s);
return i == 0 || i == 1;
@@ -226,7 +226,8 @@ is_direction (SCM s)
Interval
ly_scm2interval (SCM p)
{
- return Interval (scm_to_double (scm_car (p)), scm_to_double (scm_cdr (p)));
+ return Interval (scm_to_double (scm_car (p)),
+ scm_to_double (scm_cdr (p)));
}
Drul_array<Real>
@@ -321,19 +322,19 @@ ly_scm2offsets (SCM s)
ALIST
*/
+// This one is used nowhere.
dak 2011/10/23 21:23:11 If it is used nowhere, it should be removed. It i
bool
-alist_equal_p (SCM a, SCM b)
+ly_is_alist_equal (SCM a, SCM b)
{
- for (SCM s = a;
- scm_is_pair (s); s = scm_cdr (s))
+ if (!scm_is_pair (a) || !scm_is_pair (b))
dak 2011/10/23 21:23:11 This returns false even if both alists are empty.
+ return false;
+ for (SCM s = a; scm_is_pair (s); s = scm_cdr (s))
{
SCM key = scm_caar (s);
SCM val = scm_cdar (s);
SCM l = scm_assoc (key, b);
- if (l == SCM_BOOL_F
- || !ly_is_equal (scm_cdr (l), val))
-
+ if (scm_is_false (l) || !ly_is_equal (scm_cdr (l), val))
return false;
}
return true;
dak 2011/10/23 21:23:11 This returns true if every pair in list a is also
« Documentation/contributor/programming-work.itexi ('K') | « lily/include/lily-guile.hh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b