# Return (; a, b )

**URL:** https://discourse.julialang.org/t/return-a-b/108388
**Category:** New to Julia
**Tags:** question
**Created:** [January 5, 2024, 2:08pm UTC](https://discourse.julialang.org/t/return-a-b/108388 "2024-01-05T14:08:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jiang\_ming\_zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jiang_ming_zhang/32/204063_2.png) [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)
#### Post date: [January 5, 2024, 2:08pm UTC](https://discourse.julialang.org/t/return-a-b/108388/1 "2024-01-05T14:08:41Z")

</div>

This is the last line of a function. What does the ; mean here? I know

```julia
return (a,b)

```

is to return a tuple. But what does

```julia
return (; a,b)

```

mean?

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [January 5, 2024, 2:11pm UTC](https://discourse.julialang.org/t/return-a-b/108388/2 "2024-01-05T14:11:57Z")

</div>

It returns a NamedTuple. The syntax is sugar for `return (; a=a, b=b)`.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 5, 2024, 6:15pm UTC](https://discourse.julialang.org/t/return-a-b/108388/3 "2024-01-05T18:15:23Z")

</div>

As ever, the help is your friend:

```julia
elp?> ;
search: ;

  ;

  ; has a similar role in Julia as in many C-like languages, and is used to delimit the end of the previous statement.

  ; is not necessary at the end of a line, but can be used to separate statements on a single line or to join statements into a single expression.

  Adding ; at the end of a line in the REPL will suppress printing the result of that expression.

  In function declarations, and optionally in calls, ; separates regular arguments from keywords.

  In array literals, arguments separated by semicolons have their contents concatenated together. A separator made of a single ; concatenates vertically (i.e. along the first dimension), ;; concatenates horizontally (second dimension),
  ;;; concatenates along the third dimension, etc. Such a separator can also be used in last position in the square brackets to add trailing dimensions of length 1.

  A ; in first position inside of parentheses can be used to construct a named tuple. The same (; ...) syntax on the left side of an assignment allows for property destructuring.

  In the standard REPL, typing ; on an empty line will switch to shell mode.

```

(second to last paragraph)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [January 5, 2024, 6:57pm UTC](https://discourse.julialang.org/t/return-a-b/108388/4 "2024-01-05T18:57:23Z")

</div>

> [@nilshg](#):
>
> As ever, the help is your friend:
> 
> `elp?> ;`

(You are apparently running Julia [in London](http://dialectblog.com/2012/06/02/the-englishness-of-h-dropping/)? [Why can’t the English learn to speak?](https://www.youtube.com/watch?v=t8zhp699FXg))

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 5, 2024, 8:54pm UTC](https://discourse.julialang.org/t/return-a-b/108388/5 "2024-01-05T20:54:57Z")

</div>

I’ve clearly been here for too long (I actually do live in an area that traditionally would have been considered to be within earshot of the Bow Bells so my children are technically cockneys and do drop letters!)
