# Multi-Line Statements

**URL:** <https://discourse.julialang.org/t/multi-line-statements/3916>\
**Category:** New to Julia\
**Created:** [May 24, 2017, 7:35pm UTC](https://discourse.julialang.org/t/multi-line-statements/3916 "2017-05-24T19:35:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackels](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@Jackels](https://discourse.julialang.org/u/Jackels)\
**Post date:** [May 24, 2017, 7:35pm UTC](https://discourse.julialang.org/t/multi-line-statements/3916/1 "2017-05-24T19:35:45Z")

</div>

How do you multi-line statements in this language?  
I want to create a macro which will take quite the input and it will be unreadable if the user is forced to put it all in one line.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [May 24, 2017, 7:36pm UTC](https://discourse.julialang.org/t/multi-line-statements/3916/2 "2017-05-24T19:36:56Z")

</div>

You can use `begin` blocks. This is very common with macros:

```julia
@foo begin
    bar
    baz
end

```

Passes one argument (the begin block) to the macro `@foo`.

---

<div class="post-metadata">

**Author:** ![Jackels](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@Jackels](https://discourse.julialang.org/u/Jackels)\
**Post date:** [May 24, 2017, 7:51pm UTC](https://discourse.julialang.org/t/multi-line-statements/3916/3 "2017-05-24T19:51:18Z")

</div>

That is not helpful if you don’t want the content of the begin block to be scoped away. Which often is the case.

Is there any good reason for a macro, that expects 3 statements and does not find all 3 expression on the same line to look for them on the next line.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2017, 8:39pm UTC](https://discourse.julialang.org/t/multi-line-statements/3916/4 "2017-05-24T20:39:42Z")

</div>

`begin end` blocks do not affect the scope in Julia, though the scoping behavior of macros is subtle (as is the case in any language). If you are looking for ways to pass arguments to macros you have several options

If you want to specify arguments on multiple lines you can do

```julia
@mac(arg1, arg2,
     arg3, arg4)

```

You can also do as @mbauman suggested, be aware that in that case the `begin end` block is a single argument and is a simple data structure called an expression `Expr`.
