On Wed, 19 Mar 2025 at 11:36, Meta via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On Tuesday, 18 March 2025 at 20:00:01 UTC, Maximilian Naderer
wrote:
> Hello guys,
>
> Not sure if you are aware a pretty big Streamer made a video
> about D!
>
> Not that it’s important for me but he is really impressed with
> the language and was blown away a couple of times.
>
> https://youtu.be/Gj5310KnUTQ?si=rSP50Uf9oeb4vLm1
>
> Best regards,
> Max

"This language is garbage collected, and they're _fucking
ashamed_ of that!"

This guy is surprisingly perceptive and 100% accurate with his
cutting observations hahaha.

Why didn't his operator overloading experiment work?

struct S {
    int x;
}

// non-member opBinary
S opBinary(string s : "+")(S lh, S rh) {
    return S(lh.x + rh.x);
}

void main()
{
    S a, b;
    S s1 = a.opBinary!"+"(b); // <- UFCS works, as expected
    S s2 = a + b; // ERROR: doesn't work! why not? the rewrite should work via UFCS as above...
}

I can't imagine any good reason his experiment should have failed. I would want this too when extern to a C lib; it hasn't come up for me before, but if it did, I would log a bug instantly.