February 05, 2013
On 02/05/2013 05:17 AM, Dejan Lekic wrote:
> On Monday, 4 February 2013 at 23:02:04 UTC, MattCoder wrote:
>> And by the way, the project looks awesome!
>
> I absolutely agree.

I don't, but that's because I hate JavaScript only slightly less than PHP or Python and want to see all of them die.

-- 
Matthew Caron, Software Build Engineer
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173 x138 office
February 05, 2013
On 2013-02-05 18:24, Matthew Caron wrote:
> On 02/05/2013 05:17 AM, Dejan Lekic wrote:
>> On Monday, 4 February 2013 at 23:02:04 UTC, MattCoder wrote:
>>> And by the way, the project looks awesome!
>>
>> I absolutely agree.
>
> I don't, but that's because I hate JavaScript only slightly less than PHP or
> Python and want to see all of them die.

I have similar feelings regarding PHP and Javascript.
Not sure why you'd hate Python (except the obvious: indents, GIL).
Nevertheless I hope one day I'll be able to replace Python with D in most cases.

February 05, 2013
On 2013-02-05 18:21, Matthew Caron wrote:
> In all fairness, I wasn't aware of text until this comment, so perhaps the
> author was not either?

There are still many examples around with to!string, so it's easy not to
notice text() if you are like me and stop looking after you found something
that works. :)

In previous version of Phobos text(...) is used 168 and to!string 181 times,
and in 2.061 DMD release the proportions are rather similar.
February 05, 2013
On 2/5/13 1:04 PM, FG wrote:
> On 2013-02-05 18:21, Matthew Caron wrote:
>> In all fairness, I wasn't aware of text until this comment, so perhaps
>> the
>> author was not either?
>
> There are still many examples around with to!string, so it's easy not to
> notice text() if you are like me and stop looking after you found something
> that works. :)
>
> In previous version of Phobos text(...) is used 168 and to!string 181
> times,
> and in 2.061 DMD release the proportions are rather similar.

Care for a shotgun search/replace pull request?

Andrei
February 05, 2013
On 02/05/2013 12:54 PM, FG wrote:
> On 2013-02-05 18:24, Matthew Caron wrote:
>> I don't, but that's because I hate JavaScript only slightly less than
>> PHP or
>> Python and want to see all of them die.
>
> I have similar feelings regarding PHP and Javascript.
> Not sure why you'd hate Python (except the obvious: indents, GIL).
> Nevertheless I hope one day I'll be able to replace Python with D in
> most cases.

I have a rule - any language which does not have a method by which one can force variable predeclaration is a toy and not suitable for real work.

Perl's "use strict" is an example of this.

I've spent too long chasing data going off into the ether because I typoed a variable name in an assignment.

-- 
Matthew Caron, Software Build Engineer
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173 x138 office
February 05, 2013
I prefer to!string to text() because you can use the same to!T pattern for a great many types T.

text is something I use more only when I want to do multiple arguments together.
February 05, 2013
On 2/5/13, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
> Care for a shotgun search/replace pull request?

Looking at the implementation:

string text(T...)(T args)
{
    return textImpl!string(args);
}

private S textImpl(S, U...)(U args)
{
    S result;
    foreach (i, arg; args)
    {
        result ~= to!S(args[i]);
    }
    return result;
}

I can see 2 optimizations here:

1. Use a static if to replace the append operator with a simple return
when there's only one argument
2. Use Appender instead of a regular string for multiple arguments.

Unfortunately #2 won't fly because std.regex uses text and it expects it to be safe, but Appender isn't safe.
February 05, 2013
05-Feb-2013 22:59, Adam D. Ruppe пишет:
> I prefer to!string to text() because you can use the same to!T pattern
> for a great many types T.
>

wtext, dtext

> text is something I use more only when I want to do multiple arguments
> together.

Actually me too, to!string feels more explicit.

-- 
Dmitry Olshansky
February 05, 2013
05-Feb-2013 23:01, Andrej Mitrovic пишет:
> On 2/5/13, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
>> Care for a shotgun search/replace pull request?
>
> Looking at the implementation:
>
> string text(T...)(T args)
> {
>      return textImpl!string(args);
> }
>
> private S textImpl(S, U...)(U args)
> {
>      S result;
>      foreach (i, arg; args)
>      {
>          result ~= to!S(args[i]);
>      }
>      return result;
> }
>
> I can see 2 optimizations here:
>
> 1. Use a static if to replace the append operator with a simple return
> when there's only one argument
> 2. Use Appender instead of a regular string for multiple arguments.
>
> Unfortunately #2 won't fly because std.regex uses text and it expects
> it to be safe, but Appender isn't safe.
>

Time to make Appender @trusted and linch the author if it's not that safe inside? ;)

But seriously it would silently allow @system OutputRanges... @trusted needs re-design.

-- 
Dmitry Olshansky
February 05, 2013
On Tuesday, 5 February 2013 at 19:02:19 UTC, Dmitry Olshansky wrote:
> wtext, dtext

to!int, etc too