# Pre-RFC: variadic tuple

**URL:** <https://internals.rust-lang.org/t/pre-rfc-variadic-tuple/10878>\
**Category:** language design\
**Created:** [August 27, 2019, 8:00pm UTC](https://internals.rust-lang.org/t/pre-rfc-variadic-tuple/10878 "2019-08-27T20:00:34Z")\
**Posts on this page:** 1\
**Showing post:** 57

<div class="post-metadata">

**Author:** ![fredpointzero](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/fredpointzero/32/6040_2.png) [@fredpointzero](https://internals.rust-lang.org/u/fredpointzero)\
**Post date:** [September 12, 2019, 8:57am UTC](https://internals.rust-lang.org/t/pre-rfc-variadic-tuple/10878/57 "2019-09-12T08:57:38Z")

</div>

Hi updated the RFC with the last feedbacks:

- support for functions without recursion
- trait library utilities and their usage

Considering the ambiguous range syntax, I have several suggestions:

# Option 1 - Original

```rust
(for (ref k, map) type (K, V) in ..(k, maps) type ..(K, V) {
    HashMap::<K, V>::get(&map, k)
})

(for (ref key,) type (Key,) in ..(k,) type ..(K,) {
    Key::do_something(key)
})

```

This one is ambiguous with ranges

# Option 2 - loose the `..`

```rust
(for (ref k, map) type (K, V) in (k, maps) type (K, V) {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in k type K {
    Key::do_something(key)
})

```

In my opinion, this is dangerously close to standard for loop. Although the compiler can makes the different because variadic tuple identifier are used, but for a human, this is ambiguous.

# Option 3 - Enclosed in brackets

```rust
(for (ref k, map) type (K, V) in <k, maps> type <K, V> {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in <k> type <K> {
    Key::do_something(key)
})

```

# Option 4 - No delimiters

```rust
(for (ref k, map) type (K, V) in k, maps type K, V {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in k type K {
    Key::do_something(key)
})

```

# Option 5 - Enclosed by dot

```rust
(for (ref k, map) type (K, V) in .(k, maps). type .(K, V). {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in .k. type .K. {
    Key::do_something(key)
})

```

# Option 6 - Enclosed by flipping table

```rust
(for (ref k, map) type (K, V) in (╯°Д°)╯(k, maps)/(.□ . \) type (╯°Д°)╯(K, V)/(.□ . \) {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in (╯°Д°)╯k/(.□ . \) type (╯°Д°)╯K/(.□ . \) {
    Key::do_something(key)
})

```

# Option 7 - Prefixed by @

```rust
(for (ref k, map) type (K, V) in @(k, maps) type @(K, V) {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in @k type @K {
    Key::do_something(key)
})

```

# Option 8 - Prefixed by a dot

```rust
(for (ref k, map) type (K, V) in .(k, maps) type .(K, V) {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in @k type @K {
    Key::do_something(key)
})

```

# Option 9 - Prefixed by &~

```rust
(for (ref k, map) type (K, V) in &~(k, maps) type &~(K, V) {
    HashMap::<K, V>::get(&map, k)
})

(for ref key type Key in &~k type &~K {
    Key::do_something(key)
})

```

What do you think of theses?

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-variadic-tuple/10878)._
