Strings in DWT

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu Feb 21 17:01:50 PST 2008


Anders F Björklund wrote:
> And "string" is predefined as invariant in D2, which further complicates
> the matter and makes it a good idea to avoid redeclaring "string" type.
> ("String" would be a class normally, with the upper case letter in it ?)

Though since they're porting from Java, and a Java String[1] is 
immutable, an invariant string is actually the correct translation...
(And with array pseudo-methods, AFAICT the only aspect of Java String 
use that can't be emulated exactly is the use of '+' for concatenation 
instead of '~'. It's been a while since I used Java though, so I may be 
overlooking something)


[1] Mutable strings are implemented by StringBuffer, IIRC.


More information about the Digitalmars-d-dwt mailing list