lilypond-devel
[Top][All Lists]
Advanced

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

Re: Fixes boolean/SCM confusions, part 1. (issue 4875054)


From: Carl . D . Sorensen
Subject: Re: Fixes boolean/SCM confusions, part 1. (issue 4875054)
Date: Thu, 18 Aug 2011 18:01:36 +0000

On 2011/08/18 15:46:43, dak wrote:


http://codereview.appspot.com/4875054/diff/8002/lily/bar-check-iterator.cc#newcode52
lily/bar-check-iterator.cc:52: if (scm_is_true (tr->get_property
("ignoreBarChecks")))
As I already explained: you can't replace to_boolean with scm_is_true,
since
to_boolean( '() ) -> 0, whereas scm_is_true ( '() ) -> 1 (I apologize
for the
mixture of X and Scheme syntax), and '() is _definitely_ one value
that needs to
be interpreted as false in the context of boolean properties.

It depends.  If you want to have unset properties default to #t, then
scm_is_true is correct.

If you want to have them default to #f, then to_boolean is clearly the
correct way to go.

If you want to have a different default, depending on the property, then
we should have a robust_scm2bool that should be used in these cases.


http://codereview.appspot.com/4875054/



reply via email to

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