# \`foo = () -\> 3\` vs. \`foo() = 3\`

**URL:** <https://discourse.julialang.org/t/foo-3-vs-foo-3/59710>\
**Category:** New to Julia\
**Tags:** functions\
**Created:** [April 21, 2021, 4:34am UTC](https://discourse.julialang.org/t/foo-3-vs-foo-3/59710 "2021-04-21T04:34:33Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [April 21, 2021, 7:58am UTC](https://discourse.julialang.org/t/foo-3-vs-foo-3/59710/8 "2021-04-21T07:58:30Z")

</div>

Just for completeness, another small difference is how they’re serialized. For the anonymous version, the function definition is actually serialized, where as the non-anonymous one just the name is serialized. The niche place where this might come up is when using Distributed’s auto-global shipping, so e.g. this works,

```julia
foo = () -> 3
@fetch foo() # foo definition shipped to worker, run there, answer returned

```

whereas the non-anonymous version you need to have `foo` actually defined on all workers (since only its name is serialized), which ammounts to an `@everywhere`

```julia
foo() = 3
@fetch foo() # error

@everywhere foo() = 3
@fetch foo() # works

```

---

_[View the full topic](https://discourse.julialang.org/t/foo-3-vs-foo-3/59710)._
