[dmd-beta] dmd 1.065 and 2.050 beta

Jonathan M Davis jmdavisProg at gmx.com
Thu Oct 28 14:26:23 PDT 2010

On Thursday, October 28, 2010 06:16:46 David Simcha wrote:
> On 10/28/2010 1:24 AM, Jonathan M Davis wrote:
> > The problem is string literals. Aren't string literals immutable(char[])?
> > It seems incredibly stupid to have to write
> No, string literals are immutable(char)[].  The following code compiles
> w/ the latest beta:
> import std.string;
> void main() {
>      bool result = startsWith("Foo", "Fo");
> }

I understood that the complaint was that using literals with startsWith() didn't 
work. It was also my understanding that string literals were immutable(char []). 
I guess that I misunderstood. Well, then that's fine. Having a range variable 
that you explicitly made immutable not work with algorithms makes sense. It's 
just that having string literals fall in that camp would be a big problem and 
that was my concern.

- Jonathan M Davis

More information about the dmd-beta mailing list