string is rarely useful as a function argument

Adam D. Ruppe destructionator at gmail.com
Wed Dec 28 20:32:13 PST 2011


On Thursday, 29 December 2011 at 04:17:37 UTC, Andrei 
Alexandrescu wrote:
> If we have two facilities (string and e.g. String) we've lost. 
> We'd need to slowly change the built-in string type.

Have you actually tried to do it? Thanks to alias this, the custom
string can be used with existing std.string functions and 
assignments
from literals.

I suppose that technically there's two facilities: 
immutable(char)[]
and string, but I don't see what difference that makes at all.

string is just an alias. It could be changed to a struct with
ease; you can do it in your own private module.

I really think you (you!) are underestimating D's current 
capabilities.


(Again, I do not think this is a good move - I'm with Walter on 
it -
but let's not sell the language short.)


More information about the Digitalmars-d mailing list