Runtime code reloading in D, part 1

Philippe Sigaud philippe.sigaud at gmail.com
Sun Jan 6 11:55:02 PST 2013


On Sun, Jan 6, 2013 at 6:49 PM, Dmitry Olshansky <dmitry.olsh at gmail.com>wrote:

> Regarding toString there is a better signature that avoids useless
> allocations:
>
> void toString(scope void delegate(const (char)[]) sink);
>
> It takes a delegate to output string representation directly to the
> destination via 'sink' delegate (that may e.g. write chars to file). Plus
> the 'scope' part of declaration avoids allocating the said delegate on the
> heap.
>
> I'd even say that string toString(); is an artifact of the past, instead
> to!string should be used (if allocating a string is fine).


I know you explained that already, but see, that again slipped my mind.
This toString(sink) thingy seems cool, but is there a documentation on it
somewhere? Without a related doc, I fear no one will know this exists.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20130106/717a85d3/attachment.html>


More information about the Digitalmars-d-announce mailing list