9 hours ago

On Wednesday, 1 October 2025 at 20:00:35 UTC, monkyyy wrote:

>

On Wednesday, 1 October 2025 at 18:09:27 UTC, Ogion wrote:

>

On Wednesday, 10 September 2025 at 23:35:29 UTC, JN wrote:

>

I feel like in such scenario a warning should be issued, or even compilation error, "static array initialization expects 10 values, only 1 provided". Sooner or later someone will hit the same issue again and spend hours debugging why the array doesn't get zeroed.

Yep, the syntax should be more explicit. Something like this:

float[10] x = [42, ...];   // [42, NaN, ..., NaN]
float[10] y = [1:42, ...]; // [NaN, 42, NaN, ..., NaN]

nah they just going to break it without a replacement

you can always create a mixin

9 hours ago

On Wednesday, 1 October 2025 at 21:01:28 UTC, not you wrote:

>

On Wednesday, 1 October 2025 at 20:00:35 UTC, monkyyy wrote:

>

On Wednesday, 1 October 2025 at 18:09:27 UTC, Ogion wrote:

>

On Wednesday, 10 September 2025 at 23:35:29 UTC, JN wrote:

>

I feel like in such scenario a warning should be issued, or even compilation error, "static array initialization expects 10 values, only 1 provided". Sooner or later someone will hit the same issue again and spend hours debugging why the array doesn't get zeroed.

Yep, the syntax should be more explicit. Something like this:

float[10] x = [42, ...];   // [42, NaN, ..., NaN]
float[10] y = [1:42, ...]; // [NaN, 42, NaN, ..., NaN]

nah they just going to break it without a replacement

you can always create a mixin

replacing 1 line of code with 30 isnt great

8 hours ago

On Wednesday, 1 October 2025 at 21:28:00 UTC, monkyyy wrote:

>

On Wednesday, 1 October 2025 at 21:01:28 UTC, not you wrote:

>

On Wednesday, 1 October 2025 at 20:00:35 UTC, monkyyy wrote:

>

On Wednesday, 1 October 2025 at 18:09:27 UTC, Ogion wrote:

>

On Wednesday, 10 September 2025 at 23:35:29 UTC, JN wrote:

>

[...]

Yep, the syntax should be more explicit. Something like this:

float[10] x = [42, ...];   // [42, NaN, ..., NaN]
float[10] y = [1:42, ...]; // [NaN, 42, NaN, ..., NaN]

nah they just going to break it without a replacement

you can always create a mixin

replacing 1 line of code with 30 isnt great

how often do you need this 'feature'? can you show a real world usecase?

1 2
Next ›   Last »