tuple not part of core language
Juraj
junk at vec4.xyz
Tue Jan 20 15:37:24 UTC 2026
On Tuesday, 20 January 2026 at 13:43:02 UTC, libxmoc wrote:
> On Monday, 19 January 2026 at 15:59:48 UTC, Serg Gini wrote:
>> On Monday, 19 January 2026 at 15:53:45 UTC, DLearner wrote:
>>> Hi
>>> Is there some reason why tuples are not part of the core
>>> language (like, say, struct, which to me is v.similar) but
>>> has to be pulled in via ```import std.typecons;```?
>>
>> Just because it is not implemented by Timon in upstream D
>
> You're confusing the issue. Timon's attempted PR did try to add
> tuples to core D, but it still pulled in runtime library code -
> that's exactly the problem. A language feature that depends on
> library code violates the clean separation: it's either core or
> library, not both. I hope it won't be accepted, tuples should
> be native to the language, meaning it should not depend on
> runtime code, the compiler should support that by default, just
> like `struct`.
Even `std.typecons` tuples wound not work without D internal
knowledge about tuples. I expect `__Tuple`/`__tup` (or what ever
will be the rewrite) to be part of `core` and not part of `std`.
More information about the Digitalmars-d-learn
mailing list