Why not all statement are expressions ?
bearophile
bearophileHUGS at lycos.com
Sun Jul 15 11:17:48 PDT 2012
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
More information about the Digitalmars-d
mailing list