What happened to the elvis-operator. I though that was one of the best features. I also like scoped/stack allocated classes.
Nothing, if enough people say that they need him I will implement them again.
But maybe better. :)

class Foo
{
    final Object x;
    final Object y;

    this (Object x, Object y)
    {
        this.x = x;
        this.y = y;
    }
}

I used this all the time in D1, when "const" worked like that. Now I have to create getters for these variables instead:

class Foo
{
    private Object x_;
    private Object y_;

    this (Object x, Object y)
    {
        this.x = x;
        this.y = y;
    }

    Object x () { return x_; }
    Object y () { return y_; }
}

const in D1 isn't the const as in D2 and enforce only that the object cannot be assigned again? Strange. O.o
But then I will think about it. Schould not be much work.


Reply via email to