DMD 1.005 release

Walter Bright newshound at digitalmars.com
Wed Feb 7 16:07:59 PST 2007


BCS wrote:
> Walter Bright wrote:
>> BCS wrote:
>>> The point is to have all of the versioning done by the time you link, 
>>> that leaves a runtime check for version info.
>> Not if it's a const.
> 
> if it's a const than it should be a static if.

That depends. if and static if have many differences in how they work. 
But if will do constant folding if it can as a matter of course.

> switch(i)
> {
>   version(foo)
>     case 1:
> 
>   ...
> 
>   version(!foo)
>     case 1:
> }

C'mon,
	case 1:
		if (foo)
			...
		else
			...


> or how about
> 
> outer: while(...)
> {
>  for(...)
>  {
>   ....... // lots of nesting
>         version(Foo)
>          break outer;
>         else
>          continue outer;
>  }
> }

If someone in my employ wrote such a thing, they'd have a lot of 
'splaining to do. Version statements don't always have to be at the 
lowest level possible - they can always be moved out to higher levels, 
until you find the right abstraction spot for it.

> What I would want versioning for would be to be able to arbitrarily 
> select what I want from a set of functionalities. Then by specifying 
> that on the command line, run a build (like with bud or a makefile that 
> doesn't known jack about versions) and get what I want.
> 
> I'm at a loss as to what you envision for versioning.

I think you view version as a scalpel, while I see it as more like an axe.



More information about the Digitalmars-d-announce mailing list