# Input parsing for macros without "parantheses"

**URL:** <https://discourse.julialang.org/t/input-parsing-for-macros-without-parantheses/34068>\
**Category:** General Usage\
**Tags:** macros, metaprogramming\
**Created:** [February 1, 2020, 11:06pm UTC](https://discourse.julialang.org/t/input-parsing-for-macros-without-parantheses/34068 "2020-02-01T23:06:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [February 1, 2020, 11:06pm UTC](https://discourse.julialang.org/t/input-parsing-for-macros-without-parantheses/34068/1 "2020-02-01T23:06:18Z")

</div>

Let’s consider the macro `@mymacro` which parses some input arguments which are separated by commas as shown below.

```julia
macro mymacro(expr...)
    # ... does something with expr
    return expr
end

@mymacro(x' = x, x∈X, dim=1)

```

If I use parentheses around the input argument, they are parsed as a `Tuple`, i.e. `(:(x' = x), :(x ∈ X), :(dim = 1))` which is exactly what I like to obtain.

However, if I call the macro like this

```julia
@mymacro x' = x, x∈X, dim=1

```

because I like to leave out the parentheses which created to `Tuple` to reduce the verbosity of the macro, the input argument are parsed totally different. Because the precedence of `=` is higher than the one of `,`, the inputs are parsed as `(:(x' = ((x, x ∈ X, dim) = 1)),)`.

Is there a “best” or an “official” way to transform the parsed input `(:(x' = ((x, x ∈ X, dim) = 1)),)` obtaining from calling the macro without parantheses to the desired `(:(x' = x), :(x ∈ X), :(dim = 1))` for an arbitrary number of comma separated inputs?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 1, 2020, 11:07pm UTC](https://discourse.julialang.org/t/input-parsing-for-macros-without-parantheses/34068/2 "2020-02-01T23:07:37Z")

</div>

Without parens, macros “arguments” are space-separated. So call it without the commas.

---

<div class="post-metadata">

**Author:** ![uwechsler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uwechsler/32/5223_2.png) [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Post date:** [February 1, 2020, 11:37pm UTC](https://discourse.julialang.org/t/input-parsing-for-macros-without-parantheses/34068/3 "2020-02-01T23:37:53Z")

</div>

Thank you very much for your super fast answer! I missed this part of the documentation and tried to do some clever input parsing 🙈
