suggestion: relaxing reqirements for version and mixin

Dan murpsoft at hotmail.com
Tue Apr 3 08:20:14 PDT 2007


> > > Thomas Kuehne wrote:
> > > > if( version(STRICT){a<200 || } a>0){
> > > >     // blabla
> > > > }
> > > 
> > > Both those features smack of textual processing to me.
> > > 
> > > "Modern languages should not be text processing, they should be symbolic 
> > > processing."

To me, that looks like the way it ought to be.

It also makes sense to me to allow:

x = switch(y){  <-- ask me about the implementation
  case 3: 5;
  case 2: 4;
  case 7: 3;
  default: 1;
}

and 

double myFunc(double x)
   return std.math.log2E(x)+1;

for(int i = 0; i < 100; i++)
   x += myArray[i] - (myOtherArray[i] * i);

Why?  

For the latter two, we allow if's to be done that way.  But not for loops or functions?  Sure it's text processing.  We're feeding the compiler text instructions!  I agree, it's a bad idea to get into macro'ing - templates are already too far into that, and I don't use mixins.

These are just sensible completions of the language.



More information about the Digitalmars-d mailing list