version and debug statements

Ameer Armaly ameer_armaly at hotmail.com
Thu May 11 16:44:52 PDT 2006


"Walter Bright" <newshound at digitalmars.com> wrote in message 
news:e40g2t$2r6h$1 at digitaldaemon.com...
> Ameer Armaly wrote:
>> One situation I can see where this kind of functionality could be useful 
>> is where you want the default compiled behavior to execute a given block 
>> of code, but with a given version switch you want it taken out.  Rather 
>> than wrapping your prefered behavior in a version block, or putting in an 
>> empty version block which raises all sorts of questions, you could just 
>> say "Unless a given version specifier is defined, do this."
>
> I understand that point of view, but I suggest instead thinking about the 
> "default compiled behavior" as a "Feature", rather than a not 
> "NotFeature". You can make it the default by putting:
>
> version = Feature;
>
> at the top of the module.
What if it were across multiple files, or some other particularly large but 
modular project; I'm not saying it couldn't be done, only that it looks 
bloated.  I agree with you that multiple bool operators might be pushing 
things a bit, but a simple not operator would IMO make things efficient 
enough to where the rest of that wouldn't matter as much. 





More information about the Digitalmars-d mailing list