October 13, 2020
On 10/12/20 11:28 PM, Adam D. Ruppe wrote:
> Gotta disagree with this too. D's module system handles the name beautifully and `to` has been a smashing success with few problems in use. The response most people have with it is "wow that's the easiest thing I've ever seen in any language".

Finally someone said it. You can pry "to" outta my cold dead hands.
October 13, 2020
On 10/13/20 7:53 AM, Ogi wrote:
> On Monday, 12 October 2020 at 17:04:01 UTC, Ali Çehreli wrote:
>> The unfortunate thing in the video was 'to' is not searchable on the internet and it took them a long time to figure out how to use a to!string expression. :/
> 
> When I try to search for “dlang to” in Google, the first result points to std.conv.to page. Their problem was that their queries looked like “dlang to template”, “dlang import to module” etc. Search engines are doing a good job at searching “unsearchable” things unless you pollute your query with irrelevant words.

Also: most of the time people want to convert something to something else so they'd search for dlang convert. All of the first page results are relevant, with std.conv at the top.

October 13, 2020
On Monday, 12 October 2020 at 17:04:01 UTC, Ali Çehreli wrote:
>
> I think Levenstein distance is applied there but to suggest that a human mistook 'to' as 'No' is funny. :) Considering keyboard layouts, it can't be a typo either.
>

They are right next to each other

https://www.dvorak-keyboard.com/

But I'd never make that mistake :)
October 13, 2020
On 10/13/20 7:27 AM, Jesse Phillips wrote:
> On Monday, 12 October 2020 at 17:04:01 UTC, Ali Çehreli wrote:
>>
>> I think Levenstein distance is applied there but to suggest that a human mistook 'to' as 'No' is funny. :) Considering keyboard layouts, it can't be a typo either.
>>
> 
> They are right next to each other
> 
> https://www.dvorak-keyboard.com/
> 
> But I'd never make that mistake :)

I use Dvorak too. ;)

Ali


October 13, 2020
On Tue, Oct 13, 2020 at 09:15:54AM -0400, Andrei Alexandrescu via Digitalmars-d wrote:
> On 10/12/20 11:28 PM, Adam D. Ruppe wrote:
> > Gotta disagree with this too. D's module system handles the name beautifully and `to` has been a smashing success with few problems in use. The response most people have with it is "wow that's the easiest thing I've ever seen in any language".
> 
> Finally someone said it. You can pry "to" outta my cold dead hands.

Me too!  std.conv.to is one of the coolest things about D. If it's removed, I will die a little inside.


T

-- 
He who laughs last thinks slowest.
October 13, 2020
On 10/13/20 4:11 PM, H. S. Teoh wrote:
> On Tue, Oct 13, 2020 at 09:15:54AM -0400, Andrei Alexandrescu via Digitalmars-d wrote:

>> Finally someone said it. You can pry "to" outta my cold dead hands.
> 
> Me too!  std.conv.to is one of the coolest things about D. If it's
> removed, I will die a little inside.

Ok, me four. :)

I've defined 'as' as well but as a member function template. Something like:

  buffer.as!long
  buffer.as!(int[])  // which parses the length first

Ali
October 13, 2020
On 10/13/2020 6:15 AM, Andrei Alexandrescu wrote:
> On 10/12/20 8:36 PM, Walter Bright wrote:
>> For std2021, there should be no 2 letter names.
> "No".

That leaves me unsympathetic to claims that the spellchecker/importhinter is "broken" and the examples are "to" and "No". A disproportionately large number of typos will be matched to them.
October 13, 2020
On 10/13/20 9:59 PM, Walter Bright wrote:
> On 10/13/2020 6:15 AM, Andrei Alexandrescu wrote:
>> On 10/12/20 8:36 PM, Walter Bright wrote:
>>> For std2021, there should be no 2 letter names.
>> "No".
> 
> That leaves me unsympathetic to claims that the spellchecker/importhinter is "broken" and the examples are "to" and "No". A disproportionately large number of typos will be matched to them.

void main()
{
    auto x = to!string(1);
}

Error: template instance to!string template to is not defined

BUT you do this instead:

    auto x = 1.to!string;

And you get:

Error: no property to for type int, perhaps import std.conv; is needed?

Clearly, something is not triggering, it should be the same suggestion for both cases. (FWIW, if this bug wasn't present, the gentlemen trying out D in the stream would have immediately imported std.conv and have been done)

-Steve
October 13, 2020
On 10/13/2020 7:16 PM, Steven Schveighoffer wrote:
> void main()
> {
>      auto x = to!string(1);
> }
> 
> Error: template instance to!string template to is not defined
> 
> BUT you do this instead:
> 
>      auto x = 1.to!string;
> 
> And you get:
> 
> Error: no property to for type int, perhaps import std.conv; is needed?
> 
> Clearly, something is not triggering, it should be the same suggestion for both cases. (FWIW, if this bug wasn't present, the gentlemen trying out D in the stream would have immediately imported std.conv and have been done)

A case can always be concocted to show this either way. The two expressions are equivalent, but they place different emphasis. I.e. the first places emphasis on to being a function, the second places emphasis on to being a property.

There isn't winning with this.
October 14, 2020
On Monday, 12 October 2020 at 17:33:04 UTC, Q. Schroll wrote:
> On Monday, 12 October 2020 at 17:04:01 UTC, Ali Çehreli wrote:
>> The unfortunate thing in the video was 'to' is not searchable on the internet


> It's not even searchable on the DLang site (e.g. using site:dlang.org on DuckDuckGo);

I Ctrl-K'ed (i.e. went to the search bar in Firefox) and typed "site:dlang.org to". The first hit was the documentation for std.conv.to.

This was on Google. If anything this says more about duckduckgo.