Hi, thanks for your comments, I'll answer as I can point by point:
- Why are there different syntax forms for declaration and usage?
I find it confusing if they both share the same syntax. By using different syntax, you know exactly what you are looking at.
- There's no reason to keep using italics throughout the whole thing. Italics are for emphasis or phrases borrowed from other languages.
Noted, I'll update the RFC accordingly.
- The section on "Multiple identifier expansion forms" makes it feel like something is missing from the type signature. While there are exceptions, it is uncommon for something in rust to produce errors at monomorphization time.
I like the idea you are suggesting, embedding the length constraint in the syntax itself is nice. Although it may collide with the point made by CAD97 about recursive variadic tuple, but it is worth thinking about it.
let ({ref T}#..) = values;
Noted, I wasn't sure about this, I'll update the RFC, it will make more sense for Rust users.
- In that same section, most of the headings there are not useful.
Several points here. First of all, the section was intended to show the location where the variadic tuple can be used, not use cases of the variadic tuple. Maybe I should rephrase the section then.
Can you splat into a function call? (func(Tuple#..))
No, you will use a variadic tuple as a single argument.
Can you generate a list of statements? (maybe not? I can't picture a good syntax for it)
No, the goal is to manipulate tuples.
Although you can do something similar:
let values = (({let mut v = T::VALUE; v *= 2; v})#..);
will expand to
let values = ({let mut v = T1::VALUE; v *= 2; v}, {let mut v = T2::VALUE; v *= 2; v}, {let mut v = T3::VALUE; v *= 2; v});
for a variadic tuple instance (T1, T2, T3)
.
- Is it possible to use this to write a variadic Enum?
No, this is intended to be for tuples only.
Handling variadic enum is, in my opinion, quite different and will have way more implications that variadic tuples. So if variadic enum needs to be implemented, I think it should be in an another RFC.