October 12, 2020
On 10/12/2020 11:01 AM, Paul Backus wrote:
> Though for some reason std.conv.to is the 4th search result, after core.time.to, std.conv.castFrom.to, and (of all things) arsd.email.IncomingMessage.to.

Just shoot me now!
https://www.youtube.com/watch?v=LyPFQKpRnd0
October 12, 2020
On 10/12/2020 11:10 AM, Adam D. Ruppe wrote:
> I do need to write a new searcher though, it could be a lot better than it is right now.

There's nothing wrong with the search engine. There's a LOT wrong with global symbols named "to".
October 12, 2020
On 10/12/2020 11:17 AM, Steven Schveighoffer wrote:
> As I understand it, these functions to import mappings are hard coded in the compiler.
https://github.com/dlang/dmd/blob/master/src/dmd/imphint.d

Of course, this won't work for "to" since there are multiple declarations of "to" in Phobos (shoot me now).
October 12, 2020
On 10/12/20 4:11 PM, Walter Bright wrote:
> On 10/12/2020 11:17 AM, Steven Schveighoffer wrote:
>> As I understand it, these functions to import mappings are hard coded in the compiler.
> https://github.com/dlang/dmd/blob/master/src/dmd/imphint.d
> 
> Of course, this won't work for "to" since there are multiple declarations of "to" in Phobos (shoot me now).

What do you mean? Just add "to" : "std.conv". Is there a problem with it?

But better would be a customizable list for the compiler to read (only in the case of an unresolved symbol), then you aren't limited to a hard-coded list.

-Steve
October 12, 2020
On 10/12/20 1:08 PM, Walter Bright wrote:

> There's nothing wrong with the search engine. There's a LOT wrong with global symbols named "to".

Luckily, D does not have a global name space. Half kidding... :)

Ali
October 12, 2020
On 10/12/2020 1:46 PM, Steven Schveighoffer wrote:
> What do you mean? Just add "to" : "std.conv". Is there a problem with it?

"Though for some reason std.conv.to is the 4th search result, after core.time.to, std.conv.castFrom.to, and (of all things) arsd.email.IncomingMessage.to."

  -- Paul Backus
October 12, 2020
On 10/12/20 5:37 PM, Walter Bright wrote:
> On 10/12/2020 1:46 PM, Steven Schveighoffer wrote:
>> What do you mean? Just add "to" : "std.conv". Is there a problem with it?
> 
> "Though for some reason std.conv.to is the 4th search result, after core.time.to, std.conv.castFrom.to, and (of all things) arsd.email.IncomingMessage.to."
> 

All of those are type members, one is not even in Phobos.

A member function or field has nothing to do with suggesting an import -- if it was part of the type, it would be there to use, and would be a different kind of error if you used it wrongly.

A much more useful search would be a different issue than suggesting an import when *no* symbol is found.

-Steve
October 12, 2020
On 10/12/20 7:44 PM, Steven Schveighoffer wrote:
> On 10/12/20 5:37 PM, Walter Bright wrote:
>> On 10/12/2020 1:46 PM, Steven Schveighoffer wrote:
>>> What do you mean? Just add "to" : "std.conv". Is there a problem with it?
>>
>> "Though for some reason std.conv.to is the 4th search result, after core.time.to, std.conv.castFrom.to, and (of all things) arsd.email.IncomingMessage.to."
>>
> 
> All of those are type members, one is not even in Phobos.

Actually, core.time.to is not a member function, and I've run into problems with it in the past (in terms of error messages).

It can't be a member function, because then it disables uses like to!string.

I think we should change the name of that particular function, but I've never used it, so I don't know how disruptive that would be.

-Steve
October 12, 2020
On 10/12/2020 4:52 PM, Steven Schveighoffer wrote:
> I think we should change the name of that particular function, but I've never used it, so I don't know how disruptive that would be.

For std2021, there should be no 2 letter names.
October 13, 2020
On Monday, 12 October 2020 at 20:08:38 UTC, Walter Bright wrote:
> There's nothing wrong with the search engine.

oh it needs some work. I wrote a custom one specifically for D and while I'm reasonably happy with that it still has some missed potential and bugs.

Like http://dpldocs.info/locate/?searchTerm=Socket.select shouldn't be empty. And it should do a better job with the cross-package results.

Searching for D stuff is legitimately a pain. My search engine is better than most but it is still really just mediocre.

> There's a LOT wrong with global symbols named "to".

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".

New users just need a quick point in the right direction to understand what it is.