D1 -> D2

Walter Bright newshound2 at digitalmars.com
Thu Nov 18 12:49:10 PST 2010


Steven Schveighoffer wrote:
> It's not impossible, but Tango's #1 rule is minimize heap allocations.  
> By peppering idup everywhere, you have created a conflict with the main 
> goal.  Refactoring in these cases isn't quite as simple as you say, and 
> it certainly won't be backwards compatible.

If you know the string is unique, you can use cast(string) rather than .idup, 
and no allocations will be done.


> In general, I tried to make Tango for D2 as const aware as possible 
> (it's a standard lib, and shouldn't require people to ignore const), and 
> found all sorts of issues with it (const).  The main one that made me 
> quit was the problem that inout is supposed to solve.

Right; inout is intended to fix that.


More information about the Digitalmars-d mailing list