August 14

On Wednesday, 14 August 2024 at 14:43:53 UTC, IchorDev wrote:

>

On Wednesday, 14 August 2024 at 13:30:25 UTC, cc wrote:

>

[...]

You and no one else, you do it to yourself.

>

[...]

And apparently there are no women in the field of computer science.

>

[...]

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. D does not parse the comma-exp anymore.

August 14

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);
}
August 14

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 ;)

August 14

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

August 14

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

August 14

On Wednesday, 14 August 2024 at 16:05:16 UTC, user1234 wrote:

>

I remember now that what is deprecated is to use the result of the comma-exp.

Yes.

>

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

A tuple expression would probably require brackets:
https://forum.dlang.org/post/p3bdp1$2b4e$1@digitalmars.com

A comma expression result can't be used. I think it can only be used as an expression statement, or in the for Increment clause. Are there any cases where it could conflict with bracketed tuples? dmd accepts a comma expression with parentheses, but that would presumably be a 'has no effect' error if it was parsed as a tuple.

August 14

On Wednesday, 14 August 2024 at 20:37:26 UTC, Nick Treleaven wrote:

>

On Wednesday, 14 August 2024 at 16:05:16 UTC, user1234 wrote:

>

I remember now that what is deprecated is to use the result of the comma-exp.

Yes.

>

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

A tuple expression would probably require brackets:
https://forum.dlang.org/post/p3bdp1$2b4e$1@digitalmars.com

A comma expression result can't be used. I think it can only be used as an expression statement, or in the for Increment clause. Are there any cases where it could conflict with bracketed tuples? [...]

No, I cant see one either. Looks like the comma-exp is actually not the blocker ;)

August 15

On Wednesday, 14 August 2024 at 14:43:53 UTC, IchorDev wrote:

>

And apparently there are no women in the field of computer science.

Haha, I was expecting a technical response why my example wouldn't work, wasn't expecting gender attacks. Cool cool, D forums gonna be like that then.

August 15

On Wednesday, 14 August 2024 at 20:59:28 UTC, user1234 wrote:

>

On Wednesday, 14 August 2024 at 20:37:26 UTC, Nick Treleaven [...]

>

A comma expression result can't be used. I think it can only be used as an expression statement, or in the for Increment clause. Are there any cases where it could conflict with bracketed tuples? [...]

No, I cant see one either. Looks like the comma-exp is actually not the blocker ;)

Well this was a clumsy way to say "sorry I was wrong". However I'm pretty confident about the fact that tuples in D will take age to be accepted and implemented. I challenge you to post me an email notification when the following will work with an official D release:

static assert((0,1,2)[1] + 2 == 3);

You can find my email by scrutinizing the messages of the main commiter of https://gitlab.com/styx-lang/styx.

Sorry for the supplemental provocation but let's go: I'll try to keep the address alive for at least 5 years.

Hope to get a message soon 🤠

August 15

On Thursday, 15 August 2024 at 01:33:22 UTC, cc wrote:

>

On Wednesday, 14 August 2024 at 14:43:53 UTC, IchorDev wrote:

>

And apparently there are no women in the field of computer science.

Haha, I was expecting a technical response why my example wouldn't work, wasn't expecting gender attacks. Cool cool, D forums gonna be like that then.

Please, let's not overreact with words like "gender attacks". You referred to "a user" by "he", and IchorDev pointed this out without any attack. That's all.