Discussion of TypeTuple naming
Timon Gehr
timon.gehr at gmx.ch
Tue May 28 15:34:29 PDT 2013
Please do not destroy the structure of the discussion. Answer different
posts in different posts.
On 05/28/2013 12:23 AM, Diggory wrote:
> On Monday, 27 May 2013 at 13:42:51 UTC, Timon Gehr wrote:
>
>> It is not that similar, as it automatically expands into any context
>> and hence does not allow a nested structure.
>
> The point being? It's true that there is some special behaviour, but
> that's the same regardless of whether it's called StaticTuple or TypeTuple.
>
The point being that both StaticTuple and TypeTuple are poor names.
>> I don't think that having a construct that is restricted to just types
>> makes a lot of sense.
>
> In a language which is most emphatically statically typed
In a language that does not type check template bodies. Template
metaprogramms are essentially untyped.
Also, I can agree on statically typed, but not most emphatically
statically typed. :o)
> with built in support for class invariants and in/out contracts
and static assertions and template constraints.
> you can't see the purpose of a TypeTuple?
>
Sure. It is rather pointless. The fact that there was a template
constraint is not preserved or used for later type checking (inexistent)
of the resulting "TypeTuple" in any way.
>> TypeTuple does not implement any functionality. It is an 'identity
>> function'.
>
> And yet the documentation:
>
> http://dlang.org/tuple.html (see Type Tuples)
>
Sure.
> And the name clearly suggest that it DOES implement functionality
> - that of checking that the arguments are all types.
>
Sure. The name is the problem, even if I do not agree with your
interpretation of the documentation. (there is not enough there to
interpret.)
More information about the Digitalmars-d
mailing list