Shopping for template languages

ryuukk_ ryuukk.dev at gmail.com
Wed Aug 14 19:07:46 UTC 2024


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:
>>>>> ```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).

I expect tuple to come before that

It is sad to see D being stuck like that


More information about the Digitalmars-d mailing list