Is DMD 0.166 RC 1.0?

Ivan Senji ivan.senji_REMOVE_ at _THIS__gmail.com
Mon Sep 4 04:32:54 PDT 2006


Walter Bright wrote:
> Any compelling reason why not? I know that everyone (including me) wants 
> more features, more improvements, etc., but nothing about calling it 1.0 
> will prevent that from happening.

Maybe not the right time to mention it but: one of the most annoying 
error messages dmd produces is "is not an lvalue". An annoying message 
isn't doesn't make a good first impression, and it makes an even worse 
second or third impression.

Example:

   class A
   {
     int xx = 11;
     int opIndex(int pos){return xx;}
     int opIndexAssign(int what, int pos){return xx = what;}

     int prop(){return xx;}
     int prop(int newxx){return xx = newxx;}
   }

   auto a = new A;

   void f(inout int x)
   {
     x ++;
   }

   f(a[5]);    //((a).opIndex)(5) is not an lvalue
   f(a.prop);  //((a).prop)() is not an lvalue

Maybe a[5] isn't strictly an lvalue because it's adress can't be taken 
but, it would make much sense for the compiler to translate those cases 
to (and shouldn't be that hard to do):

auto x = a[5];
   f(x);
a[5] = x;

auto y = a.prop;
   f(y);
a.prop = y;

I don't want to sound lika a D-hater because of my recent (complaining) 
posts but just trying to show that although D is a fantastic language it 
is still a little too rough around the edges.





More information about the Digitalmars-d-announce mailing list