I'm not adverse to this. We would get some type safety, but would this introduce any problems or backwards imcompatibilities redefining the macro's which are named constants to use static const's and enums? (I'm assuming no thinking it out in my head). Is the performance impact negligible or even non-existent (i.e. will compilers optimize the const out and inline it)? That leads me to wonder too would replacing macro's that are bodies of code with inline methods be equivalent after compilation? steven On 5/3/07, Michael Gogins wrote: > 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 > 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