Shopping for template languages
user1234
user1234 at 12.de
Wed Aug 14 16:05:16 UTC 2024
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:
>>>> ```d
>>>> 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?
>> ```d
>> 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).
More information about the Digitalmars-d
mailing list