# All ways to define functions in Julia?

**URL:** https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816
**Category:** General Usage
**Tags:** functions
**Created:** [August 31, 2020, 6:28am UTC](https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816 "2020-08-31T06:28:30Z")
**Posts on this page:** 1
**Showing post:** 39

<div class="post-metadata">

### Author: ![Pangoraw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pangoraw/32/24719_2.png) [@Pangoraw](https://discourse.julialang.org/u/Pangoraw)
#### Post date: [June 2, 2021, 9:37am UTC](https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816/39 "2021-06-02T09:37:18Z")

</div>

I am not too sure but I would say that multiple unrelated expressions are parsed as a block so `(x;y)` is a valid block. You can then replace `(x;y)` by `begin; x; y; end` in the function declaration.

```julia
julia> :((x;y)) |> dump
Expr
  head: Symbol block
  args: Array{Any}((3,))
    1: Symbol x
    2: LineNumberNode
      line: Int64 1
      file: Symbol REPL[1]
    3: Symbol y

```

---

_[View the full topic](https://discourse.julialang.org/t/all-ways-to-define-functions-in-julia/45816)._
