More D newb questions.

Me Here p9e883002 at sneakemail.com
Mon May 5 20:34:32 PDT 2008


BCS wrote:

> Derek Parnell wrote:
> > > > Similarly, there's no technical reason for not allowing lvalue slice
> > > > assignments to grow or shrink the target, or do overlapping copies. 
> 
> [...]
> > 
> > 
> > Huh? Why would the length change? t[5..5] = "," should fail because the
> > left and right sides of the assign are different lengths.
> > 
> 
> I may be miss reading the OP but I think he was suggesting that D allow
> assigning a slice of one size to a slice of another where this would change
> the length of the array that was assigned into. If I'm wrong, I'm wrong.

You're not wrong. That is exactly the expectation I had. Based upon my use of
other modern langauges.

Sorry to quote the overview again but it was never more relevant.

	String manipulation is so common, and so clumsy in C and C++, 
	that it needs direct support in the language. Modern languages 
	handle string concatenation, copying, etc., and so does D. 
	Strings are a direct consequence of improved array handling.


-- 




More information about the Digitalmars-d mailing list