project-ideas icon indicating copy to clipboard operation
project-ideas copied to clipboard

First class tuples

Open 12345swordy opened this issue 4 years ago • 8 comments

write a dip that makes tuples built into the language itself to avoid writing tuple!(....) and other unneeded verbiage.

12345swordy avatar Apr 14 '20 01:04 12345swordy

Do you mean tuple(), from std typecons? or do you mean AliasSeq from std.meta?

In terms of aliasSeq that's something we actually need and I am working on it.

UplinkCoder avatar Apr 14 '20 05:04 UplinkCoder

tuple() from std typecons

12345swordy avatar Apr 14 '20 20:04 12345swordy

we are a strongly typed language, why don't you create a struct instead?

UplinkCoder avatar Apr 18 '20 15:04 UplinkCoder

we are a strongly typed language, why don't you create a struct instead?

That is a complete non sequitur. C# is a strongly typed language, yet it has first class tuples built in.

12345swordy avatar Apr 19 '20 20:04 12345swordy

There is a tuple dip started some years ago https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md

andre2007 avatar Apr 19 '20 20:04 andre2007

we are a strongly typed language, why don't you create a struct instead?

There's a difference between duck typing and structural typing. That being said, there's a strong preference (or there was, from Andrei) to have things that can be built as library, be in a library, so this DIP is likely to be an uphill battle.

@12345swordy : Are you volunteering ?

Geod24 avatar Apr 19 '20 23:04 Geod24

@Geod24 Yes I am willing to volunteer on this, if people are willing to assist me on this as I have time restraint on this.

12345swordy avatar Apr 20 '20 01:04 12345swordy

I wonder whether it makes sense to have it as a gsoc project: complete the DIP (https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md) and drive through the dip process? Of course that means here is no coding at all to be written by the student...

andre2007 avatar Dec 04 '20 11:12 andre2007