[phobos] expand for std.metastrings

Jimmy Cao jcao219 at gmail.com
Tue Nov 2 14:09:08 PDT 2010


On Tue, Nov 2, 2010 at 3:30 PM, Andrei Alexandrescu <andrei at erdani.com>
 wrote:

> On 11/2/10 3:16 PM, kenji hara wrote:
>
>> And, I do not recommend following use of expand:
>> writeline(mixin(expand!"take $n times."));
>>
>> The probrem is:
>> - expand concatenates string by ~ operators, it is may cost than using
>> appender(text, formatWrite, writefln...)
>>
>> I will remove ddoc example from github code.
>>
>
> Expand should have an option to expand with commas and without to!string,
> i.e. in order to make the code:
>
> writeln(mixin(anotherexpand!"take $n times."));
>
> identical 100% with the code
>
> writeln("take ", n, " times.");
>
> Not sure what's the best name for "anotherexpand".
>
> Andrei
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
Something like expandsplit?
I'm thinking of that because Python has "one two three".split()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20101102/5067499c/attachment.html>


More information about the phobos mailing list