lilypond-devel
[Top][All Lists]
Advanced

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

Re: Uninitialized SCM variables


From: Carl Sorensen
Subject: Re: Uninitialized SCM variables
Date: Thu, 18 Aug 2011 08:11:41 -0600

On 8/17/11 11:32 PM, "Dan Eble" <address@hidden> wrote:

> 
> Backing upS I believe the compiler will initialize the bits in the
> aforementioned variables to zero, but is zero a desirable default for SCM
> variables in general, and these in particular?

Yes.  In this case, if we were to initialize it, it would be to zero, which
indicate that it has not been given a SCM value.

> 
> It also just sank in that in another thread there was a statement that
> treating a SCM as a boolean is "very wrong".  That would include a number of
> lines in ly_property_lookup_stats and note_property_access that use these
> variables.

The thing that is wrong is treating a SCM boolean as if it's a C boolean.

In this case, we're looking for a non-zero value of the SCM variable,
indicating that it has been set.

HTH,

Carl




reply via email to

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