www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: D's greatest mistakes

reply Kagamin <spam here.lot> writes:
Steven Schveighoffer Wrote:

 lack of tail-const/immutable for classes.
 
 And no, Rebindable doesn't cut it.

As I understand, it's primarily issue for collections?
Nov 29 2010
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, November 29, 2010 12:48:45 Kagamin wrote:
 Steven Schveighoffer Wrote:
 lack of tail-const/immutable for classes.
 
 And no, Rebindable doesn't cut it.

As I understand, it's primarily issue for collections?

The lack of tail-const is a particularly big problem for handling ranges, I believe. It means that certain things will work with arrays which won't work with user-defined ranges. - Jonathan M Davis
Nov 29 2010
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Mon, 29 Nov 2010 15:53:51 -0500, Jonathan M Davis <jmdavisProg gmx.com>  
wrote:

 On Monday, November 29, 2010 12:48:45 Kagamin wrote:
 Steven Schveighoffer Wrote:
 lack of tail-const/immutable for classes.

 And no, Rebindable doesn't cut it.

As I understand, it's primarily issue for collections?

The lack of tail-const is a particularly big problem for handling ranges, I believe. It means that certain things will work with arrays which won't work with user-defined ranges.

Yes, this applies to non-classes as well, thanks for pointing that out. But no tail-const for classes is a glaring mistake to anyone learning the language. Tail-const for ranges is a bit more obscure. -Steve
Nov 29 2010