| I suggest using an enum or a constant static variable instead of a macro.
Regards,
Mike
-----Original Message-----
>From: Steven Yi
>Sent: May 3, 2007 10:24 AM
>To: Developer discussions
>Subject: Re: [Cs-dev] build issues
>
>Hi All,
>
>I agree with John regarding giving names to constants, and find that
>using macros for TRUE and FALSE when coding in C to be completely
>logical since there is no true and false built into the language. I
>would rather like having a TRUE and FALSE globally defined for csound
>in csoundCore.h with an #ifdef.
>
>However, I also agree with Michael that macros can be very problematic
>for most of the reasons he cited, but only when it is used as
>shorthand for a body of code and not when used to name constants. (It
>is one of the reasons I recommend to Csound users to use User-Defined
>opcodes instead of macro's). If C macro's worked safely like Guile's
>hygenic macro system (which I find incredibly elegant) it'd be great
>to use, but since it is just text replacement it can cause the
>problems mentioned by MIchael.
>
>Regarding Richard's observation about 0 not always being false, I find
>that in those cases 0 is often defined as SUCCESS and other values
>defined ase some kind of FAILURE or something like that, rather than
>FALSE/TRUE.
>
>steven
>
>
>On 5/1/07, jpff wrote:
>> OK since we are playing these games, I have earned my living
>> programming for 36 years, and have been full-time programming for 40.
>> I disagree. Indeed I was berating students last week for bare 1000
>> and 92 in their compilers when they meant HASHSIZE or the like. I
>> have also taught COBOL where the use of names for constants is
>> important.
>> Anyway, I like macros.
>> ==John ffitch
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |