| |
 | Posted by ryuukk_ in reply to user1234 | Permalink Reply |
|
ryuukk_ 
Posted in reply to user1234
| On Wednesday, 14 August 2024 at 16:05:16 UTC, user1234 wrote:
> On Wednesday, 14 August 2024 at 15:52:08 UTC, user1234 wrote:
> On Wednesday, 14 August 2024 at 15:23:45 UTC, IchorDev wrote:
> On Wednesday, 14 August 2024 at 15:03:44 UTC, user1234 wrote:
> > Now let’s try to use the same syntax for type-inferred struct constructors:
MyStruct s = (1, 2, 3);
Oh look, a comma expression!
Oh look, a tuple-exp implictly converted using structural typing methods.
Hey, cool idea. We’re need to have tuples first, though.
> D does not parse the comma-exp anymore.
So how does this print 3?
import std.stdio;
void main(){
int n;
n++, n++, n++;
writeln(n);
}
my bad, I thought it was at least deprecated ;)
I remember now that what is deprecated is to use the result of the comma-exp. I just wanna say, off-topic, that if D wants tuples, it would be time to fully deprecate the exp, depending on if you want tuples in 3 (deprecate now) or 6 years (do nothing for now).
I expect tuple to come before that
It is sad to see D being stuck like that
|