Reddit: why aren't people using D?

Eldar Insafutdinov e.insafutdinov at gmail.com
Thu Jul 23 14:53:11 PDT 2009


Michiel Helvensteijn Wrote:

> Lutger wrote:
> 
> > There have been a lot of discussions on this topic in the past but I can't
> > recall any conclusions. Perhaps some brave soul would dare to write a DIP
> > on properties?
> 
> Property DIPs have been offered in the newsgroup in the past, only before
> they were called DIPs. I also offered a possible design:
> 
> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=81759
> 
> Feel free to modify and/or DIPify it.
> 
> -- 
> Michiel Helvensteijn
> 

from your post:

property int length {
    get() { return this.len; }
    set(newLen) { this.len = newLen; }
    void opIncrement() { this.len++; }
}

I don't think that's flexible to overload every operator to get the best performance. As Walter likes to say the best way should be the most obvious. Besides we forgot that D2 allows to return references, which eliminates the issue.



More information about the Digitalmars-d mailing list