October 14, 2020
On Tuesday, 13 October 2020 at 13:15:54 UTC, Andrei Alexandrescu 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.

+1
October 14, 2020
On 10/14/20 12:05 AM, Walter Bright wrote:
> 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.

You might be missing the fact that when I call a function as a function, and not a method, it doesn't suggest any imports.

This problem doesn't happen with writeln:

void main()
{
    writeln("hello, world");
}

Error: writeln is not defined, perhaps import std.stdio; is needed?

I expect the compiler to suggest an import of std.conv when I use `to` in the *same way*.

> There isn't winning with this.

I don't have any idea what you mean. You mean, the feature to suggest imports is useless? There's no way to fix it?

Here's a full bug report: https://issues.dlang.org/show_bug.cgi?id=21308

-Steve
October 14, 2020
On 10/14/2020 8:32 AM, Steven Schveighoffer wrote:
> On 10/14/20 12:05 AM, Walter Bright wrote:
>> There isn't winning with this.
> I don't have any idea what you mean.

It's stepping on a ripple in a carpet. It doesn't flatten the carpet, it just shifts the ripple to another spot.
October 14, 2020
On 10/14/2020 3:44 AM, Atila Neves wrote:
>> 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.


I read that Google customizes searches to the individual based on their past behavior. So what other people see when they search is not what you're likely to see, especially if Google knows you hang out on dlang.org.
October 14, 2020
On Wednesday, 14 October 2020 at 20:29:48 UTC, Walter Bright wrote:
> On 10/14/2020 3:44 AM, Atila Neves wrote:
>>> 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.
>
>
> I read that Google customizes searches to the individual based on their past behavior. So what other people see when they search is not what you're likely to see, especially if Google knows you hang out on dlang.org.

I don't use Google for anything but it comes up first for me. Anyone using the search bar in the upper right of this page will have it as the first result. It's the first result on Bing. It's the fifth result on DDG.
October 14, 2020
On 10/14/20 4:29 PM, Walter Bright wrote:
> On 10/14/2020 3:44 AM, Atila Neves wrote:
>>> 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.
> 
> 
> I read that Google customizes searches to the individual based on their past behavior. So what other people see when they search is not what you're likely to see, especially if Google knows you hang out on dlang.org.

Just open a new anonymous window to get non-personalized searches.
October 15, 2020
On 10/14/20 4:27 PM, Walter Bright wrote:
> On 10/14/2020 8:32 AM, Steven Schveighoffer wrote:
>> On 10/14/20 12:05 AM, Walter Bright wrote:
>>> There isn't winning with this.
>> I don't have any idea what you mean.
> 
> It's stepping on a ripple in a carpet. It doesn't flatten the carpet, it just shifts the ripple to another spot.

Walter, there's a bug in the compiler code that suggests an import for a symbol such that in certain cases when you use the symbol and that symbol isn't defined, it doesn't suggest the import. It doesn't suggest anything. It doesn't shift to another spot. If you fix the bug, it should always suggest the import.

-Steve
October 16, 2020
On 10/15/2020 5:56 AM, Steven Schveighoffer wrote:
> Walter, there's a bug in the compiler code that suggests an import for a symbol such that in certain cases when you use the symbol and that symbol isn't defined, it doesn't suggest the import. It doesn't suggest anything. It doesn't shift to another spot. If you fix the bug, it should always suggest the import.

I don't agree that suggesting a global function for a .property is the most useful hint.

It's clearly a subjective opinion. But eventually there will be another "bug" report about why the hint is obviously wrong. That's par for the course whenever the compiler makes a suggestion about a fix.
October 16, 2020
On Friday, 16 October 2020 at 07:09:39 UTC, Walter Bright wrote:
> On 10/15/2020 5:56 AM, Steven Schveighoffer wrote:
>> Walter, there's a bug in the compiler code that suggests an import for a symbol such that in certain cases when you use the symbol and that symbol isn't defined, it doesn't suggest the import. It doesn't suggest anything. It doesn't shift to another spot. If you fix the bug, it should always suggest the import.
>
> I don't agree that suggesting a global function for a .property is the most useful hint.
>
> It's clearly a subjective opinion. But eventually there will be another "bug" report about why the hint is obviously wrong. That's par for the course whenever the compiler makes a suggestion about a fix.

It seems you missed one crucial point here: the suggestion to import std.conv
*does* happen when invoked as 1.to!string, but *not* when invoked as to!string(1). It's already doing what you say is not the most useful hint, and failing to give a hint when to!string is invoked as a function call.

unittest {
    // template instance to!string template to is not defined
    auto x = to!string(1);

    // no property to for type int, perhaps import std.conv; is needed?
    auto y = 1.to!string;
}

--
  Simen
October 16, 2020
On Wednesday, 14 October 2020 at 20:29:48 UTC, Walter Bright wrote:
> On 10/14/2020 3:44 AM, Atila Neves wrote:
>>> 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.
>
>
> I read that Google customizes searches to the individual based on their past behavior. So what other people see when they search is not what you're likely to see, especially if Google knows you hang out on dlang.org.

Correct - and it'd be likely of anyone else searching for that as well.
1 2 3 4 5 6
Next ›   Last »