DIP9 -- Redo toString API

"Jérôme M. Berger" jeberger at free.fr
Sun Nov 21 13:33:19 PST 2010


spir wrote:
> On Sun, 21 Nov 2010 17:28:09 +0100
> Pelle Månsson <pelle.mansson at gmail.com> wrote:
> 
>> However, writeln can do this:
>>
>>      foreach (arg; args) {
>>          arg.writeTo((const(char)[] data) { outputbuffer.put(data); })
>>      }
>>
>> thereby removing the need to store the string, and the extra allocations.
>>
>> This design is much cleaner than the current strategy, and also more 
>> flexible.
> 
> (Sorry for the irony.) "Make simple things easy." Have to write a delegate to get feedback... to print a bit of text.
> (What is "hello, world!" in D?)
> 
	Like others have said, the only change to user code is that you
will write "to!string (x)" instead of "x.toString()" How is that
less easy?

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101121/51290548/attachment-0001.pgp>


More information about the Digitalmars-d mailing list