Re: FYI my experience with D' version

2012-07-30 Thread Adam D. Ruppe
On Sunday, 29 July 2012 at 19:20:30 UTC, Jacob Carlborg wrote: You could use versions which sets bool variables and use static-if. I don't know if that's any better. It'd still have the problem of the global name. Consider: -version=use_foo but then lib a and lib b both have: version(use_foo

Re: FYI my experience with D' version

2012-07-30 Thread Adam D. Ruppe
On Monday, 30 July 2012 at 10:30:12 UTC, torhu wrote: I think there was a discussion about this a few years ago, Walter did it this way on purpose. Can't remember the details, though. Hell, that might have been me. I first realized version doesn't work for what I was using it for a couple yea

Re: FYI my experience with D' version

2012-07-30 Thread Don Clugston
On 30/07/12 14:32, Jacob Carlborg wrote: On 2012-07-30 12:30, torhu wrote: version is good for global options that you set with -version on the command line. And can also be used internally in a module, but doesn't work across modules. But it seems you have discovered this the hard way alread

Re: FYI my experience with D' version

2012-07-30 Thread Jacob Carlborg
On 2012-07-30 12:30, torhu wrote: version is good for global options that you set with -version on the command line. And can also be used internally in a module, but doesn't work across modules. But it seems you have discovered this the hard way already. I think there was a discussion about t

Re: FYI my experience with D' version

2012-07-30 Thread torhu
On 28.07.2012 22:55, Adam D. Ruppe wrote: After some experience, I've come to the conclusion that using D's version() with custom things is usually a mistake. Not always - I think it is still good for platform like tweaks, version(X86) or version(Windows), or even version(Custom_Library), (note,

Re: FYI my experience with D' version

2012-07-30 Thread Tobias Pankrath
The biggest downside is if you add a function, you have to go back to ALL the config files and add it in to make the project compile. enum bool wantsNewFeature = false; which can be a hassle if you have like 20 config files. But, this is good and bad because it does make you think about it

Re: FYI my experience with D' version

2012-07-29 Thread Jacob Carlborg
On 2012-07-29 18:42, Adam D. Ruppe wrote: I just hit another downside with custom version(): two libraries might use the same name to mean different things. The version has no namespacing, so that's another reason for not using it for custom things. The config modules might be the best idea for

Re: FYI my experience with D' version

2012-07-29 Thread Adam D. Ruppe
I just hit another downside with custom version(): two libraries might use the same name to mean different things. The version has no namespacing, so that's another reason for not using it for custom things. The config modules might be the best idea for libraries too. I wonder if we could do a d

FYI my experience with D' version

2012-07-28 Thread Adam D. Ruppe
After some experience, I've come to the conclusion that using D's version() with custom things is usually a mistake. Not always - I think it is still good for platform like tweaks, version(X86) or version(Windows), or even version(Custom_Library), (note, it is often smart to put an "else static as