# Compact syntax for combining \`Tuple\` and \`NamedTuple\`: \`(1, 2; x=2, y=3) == ((1, 2), (x=2, y=3))\`

**URL:** <https://discourse.julialang.org/t/compact-syntax-for-combining-tuple-and-namedtuple-1-2-x-2-y-3-1-2-x-2-y-3/78101>\
**Category:** Internals & Design\
**Created:** [March 18, 2022, 6:12pm UTC](https://discourse.julialang.org/t/compact-syntax-for-combining-tuple-and-namedtuple-1-2-x-2-y-3-1-2-x-2-y-3/78101 "2022-03-18T18:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![mtfishman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtfishman/32/30755_2.png) [@mtfishman](https://discourse.julialang.org/u/mtfishman)\
**Post date:** [March 21, 2022, 6:07pm UTC](https://discourse.julialang.org/t/compact-syntax-for-combining-tuple-and-namedtuple-1-2-x-2-y-3-1-2-x-2-y-3/78101/13 "2022-03-21T18:07:25Z")

</div>

> [@Henrique\_Becker](#):
>
> Sincerely, thinking a little more about the subject, I think this is a no-go because of ambiguity.
> 
> ```julia
> julia> (1; x = 2)
> 2
> 
> ```
> 
> For elements with a single positional argument and a single keyword argument the syntax already means _do anything before the `;` and then set the variable after the `;`_ .

What if we required a trailing comma for that case?

```julia
julia> (1; x=2)
2

julia> (1,; x=2)
ERROR: syntax: unexpected semicolon in tuple around REPL[24]:1
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

```

Not much different from disambiguating `(1)` from `(1,)` for making either an expression or `Tuple`.

---

_[View the full topic](https://discourse.julialang.org/t/compact-syntax-for-combining-tuple-and-namedtuple-1-2-x-2-y-3-1-2-x-2-y-3/78101)._
