Thread overview
alias sequences of sequences
Apr 07
Alex
Apr 07
ag0aep6g
Apr 07
aliak
April 07
Is there any way to get sequences of sequences?

Using RT, I have to use strings

[[`string`, `0`], ...]

when it would be much better to use

[[string, 0], ...]

Ideally it wouldn't add so much overhead that it defeats the purpose.



April 07
On 07.04.19 06:58, Alex wrote:
> Is there any way to get sequences of sequences?
> 
> Using RT, I have to use strings
> 
> [[`string`, `0`], ...]
> 
> when it would be much better to use
> 
> [[string, 0], ...]
> 
> Ideally it wouldn't add so much overhead that it defeats the purpose.

You can make a template that doesn't expand the sequence automatically, and then make a sequence of those:

----
template Box(stuff ...) { alias contents = stuff; }
import std.meta: AliasSeq;
alias s = AliasSeq!(Box!(string, 0), Box!(int, 42));
----

Instead of `s[0][0]`, you'd have to write `s[0].contents[0]`. Don't know if that's too much overhead.
April 07
On Sunday, 7 April 2019 at 04:58:13 UTC, Alex wrote:
> Is there any way to get sequences of sequences?
>
> Using RT, I have to use strings
>
> [[`string`, `0`], ...]
>
> when it would be much better to use
>
> [[string, 0], ...]
>
> Ideally it wouldn't add so much overhead that it defeats the purpose.

https://aliak00.github.io/bolts/bolts/meta/AliasPack.html