January 06, 2021
On Wednesday, 6 January 2021 at 11:29:42 UTC, Ola Fosheim Grøstad wrote:
> On Wednesday, 6 January 2021 at 11:18:22 UTC, Basile B. wrote:
>> I thought about auto when reading the DIP too, but auto is more used like a Type (although being a storage class ;) ). It's never used to infer a value, i.e an expression. While I understand what you mean this is unrelated. Dollar is very well suited.
>
> Hmm...
>
> My take is that this proposal is auto with a constraint, except it will also do implicit conversion.

yeah the split of DIP feedbacks and DIP discussions was clearly not a bad thing ^^
January 06, 2021
On Wednesday, 6 January 2021 at 11:39:08 UTC, Basile B. wrote:
>> Hmm...
>>
>> My take is that this proposal is auto with a constraint, except it will also do implicit conversion.
>
> yeah the split of DIP feedbacks and DIP discussions was clearly not a bad thing ^^

Do you disagree?
January 06, 2021
On Wednesday, 6 January 2021 at 11:55:12 UTC, Ola Fosheim Grøstad wrote:
> On Wednesday, 6 January 2021 at 11:39:08 UTC, Basile B. wrote:
>>> Hmm...
>>>
>>> My take is that this proposal is auto with a constraint, except it will also do implicit conversion.
>>
>> yeah the split of DIP feedbacks and DIP discussions was clearly not a bad thing ^^
>
> Do you disagree?

No. I agree. Do you imagine if this conversation was in the offical DIP review.
E.g those two a**holes who troll the review process /s
January 06, 2021
On Wednesday, 6 January 2021 at 12:02:05 UTC, Basile B. wrote:
> No. I agree. Do you imagine if this conversation was in the offical DIP review.
> E.g those two a**holes who troll the review process /s

LOL, people have their own frame of reference so the shorter the DIP the more interpretations you get. :-D

January 06, 2021
On Wednesday, 6 January 2021 at 09:21:53 UTC, Mike Parker wrote:
>
> Here in the discussion thread, you are free to discuss anything and everything related to the DIP. Express your support or opposition, debate alternatives, argue the merits, etc.
>

I think the DIP is useful and deals properly with degenerated cases.
January 06, 2021
On Wednesday, 6 January 2021 at 09:24:28 UTC, Mike Parker wrote:

> The Feedback Thread is here:
> https://forum.dlang.org/post/qglydztoqxhhcurvbxhs@forum.dlang.org

Why not "int[auto] arr = [1, 2, 3]" ?
IMHO auto keyword is less ambiguous than $.
January 06, 2021
On Wednesday, 6 January 2021 at 13:48:52 UTC, angel wrote:
> On Wednesday, 6 January 2021 at 09:24:28 UTC, Mike Parker wrote:
>
>> The Feedback Thread is here:
>> https://forum.dlang.org/post/qglydztoqxhhcurvbxhs@forum.dlang.org
>
> Why not "int[auto] arr = [1, 2, 3]" ?
> IMHO auto keyword is less ambiguous than $.

Someone else could misunderstand `auto` to mean partial type deduction on associative array, e.g. `int[auto] arr = ["Hello": ubyte(1), "World": ubyte(2)];`.
Personally, I think `$` is very natural here, but I also didn't consider `auto` before.
January 06, 2021
On Wednesday, 6 January 2021 at 14:03:14 UTC, Mathias LANG wrote:
> On Wednesday, 6 January 2021 at 13:48:52 UTC, angel wrote:
>> On Wednesday, 6 January 2021 at 09:24:28 UTC, Mike Parker wrote:
>>
>>> The Feedback Thread is here:
>>> https://forum.dlang.org/post/qglydztoqxhhcurvbxhs@forum.dlang.org
>>
>> Why not "int[auto] arr = [1, 2, 3]" ?
>> IMHO auto keyword is less ambiguous than $.
>
> Someone else could misunderstand `auto` to mean partial type deduction on associative array, e.g. `int[auto] arr = ["Hello": ubyte(1), "World": ubyte(2)];`.
> Personally, I think `$` is very natural here, but I also didn't consider `auto` before.

$ is very much appropriate imho, as it implies the length of the array. auto suggests a type (or storage class) and has only barely a link with arrays.

January 06, 2021
On 2021-01-06 10:21, Mike Parker wrote:
> This is the discussion thread for the first round of Community Review of DIP 1039, "Static Arrays with Inferred Length":
> 
> https://github.com/dlang/DIPs/blob/c06ce7f144b3dabf363d1896ddcd31a2a6b7c969/DIPs/DIP1039.md 

There's `staticArray` to solve this issue [1].

[1] https://dlang.org/phobos/std_array.html#.staticArray

-- 
/Jacob Carlborg
January 06, 2021
On Wednesday, 6 January 2021 at 17:59:57 UTC, Jacob Carlborg wrote:
> On 2021-01-06 10:21, Mike Parker wrote:
>> This is the discussion thread for the first round of Community Review of DIP 1039, "Static Arrays with Inferred Length":
>> 
>> https://github.com/dlang/DIPs/blob/c06ce7f144b3dabf363d1896ddcd31a2a6b7c969/DIPs/DIP1039.md
>
> There's `staticArray` to solve this issue [1].
>
> [1] https://dlang.org/phobos/std_array.html#.staticArray

It works only for the `int` type and above (and other types as structs).

example with short:
---
extern(C) void main()
{
    import std.array;
    auto a = [0, 1].staticArray!short;  // error
}
---

To fix that, I need to cast every element:
---
extern(C) void main()
{
    import std.array;
    auto a = [cast(short) 1, cast(short) 2].staticArray!short; // ok
}
---