DIP54 : revamp of Phobos tuple types

Timon Gehr timon.gehr at gmx.ch
Sun Dec 29 16:20:42 PST 2013


On 12/29/2013 10:41 PM, Dicebot wrote:
>...
> "Use in static foreach" - works with alias this
>
> "Use in special expressions that operate on types, such as `is`,
> `typeof` and `typeid`" - any code that does on expanded lists right now
> is completely broken and must be re-written according to existing spec.
> Exanded argument list is not a valid type for any of those entities
> (despite it is magically accepted). Indexing single element works with
> "alias this".
> ...

What would be an example of code that you consider to be broken?
(TemplateArgumentList!(int, double) is a valid type and 
TemplateArgumentList!(1, 2.0) is a value of that type.)

> ...
>
> Only thing I have difficulties with right now is defining static opSlice
> for Pack so that it may return another Pack instead of raw list. But
> that looks like compiler defect and should work as far as I read the
> spec.

This problem is also present in std.typecons.Tuple. Where does the spec 
claim that static opSlice can work for this use case? I find the fact 
that alias this is required for implementation of either Tuple or Pack 
to be an annoying language limitation.

> I will work on DMD PR if this is going to be accepted as "the way".

I think this will require another DIP.


More information about the Digitalmars-d mailing list