I dun a DIP, possibly the best DIP ever

Steven Schveighoffer schveiguy at gmail.com
Thu Apr 23 16:26:28 UTC 2020


On 4/23/20 9:53 AM, Manu wrote:

> 
> You can do this by expanding tuples with the appropriate indices:
>    fun(Xs[CrossIndexX], Ys[CrossIndexY])...
> Where CrossIndexX is (0, 0, 1, 1) and CrossIndexY is (0, 1, 0, 1).

I don't think this works, aren't Xs and Ys tuples also?

I think what you need is to expand the Xs and Ys into further tuples:

alias XParams = Xs[CrossIndexX]...;
alias YParams = Ys[CrossIndexY]...;
fun(XParams, YParams)...;

Which would work I think.

this means you need 4 pre-expression declarations! Two for the X and Y 
expansions, and two for the indexes.

-Steve


More information about the Digitalmars-d mailing list