David Piepgrass:

Or how about:

auto area = {
    auto tmp = foo.bar(baz);
    tmp.width * tmp.height;
}

Rust is like that, but I don't see it as a significant improvement.


I also wish "void" were a first-class type with sizeof==0 for maximum efficiency:

    int[void] intSet = [2:(), 3:(), 4:()]

I prefer:

auto intSet = hashSet([2, 3, 4]);


Ditto for size of empty structs.

There are reasons for D empty structs to be of 1 byte.


D code should never need abominations like the C++ EBCO.

In D classes are never really empty (2 words is their minimum size, not counting GC bookkeeping), and there is no normal struct inheritance.

Bye,
bearophile

Reply via email to