# Function syntax 

**URL:** <https://discourse.julialang.org/t/function-syntax/22672>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 3, 2019, 2:41am UTC](https://discourse.julialang.org/t/function-syntax/22672 "2019-04-03T02:41:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yingjerkao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yingjerkao/32/7658_2.png) [@yingjerkao](https://discourse.julialang.org/u/yingjerkao)\
**Post date:** [April 3, 2019, 2:41am UTC](https://discourse.julialang.org/t/function-syntax/22672/1 "2019-04-03T02:41:21Z")

</div>

I encounter a code snippet like this

```julia
struct F
   matt::Mtype
   latt::LType
end
function (U::F)(x::Tuple)
    idx = getindex(U.latt, x)
    getindex(U.matt, idx...)
end

```

I can call the function using an instance of `F`, say `A=F()`, and `A((3,2))` gives some sensible answer.  
`methods(A)` gives `1 method for for generic function "(::F)"`  
I couldn’t find where this type of usage is documented and how to understand this syntax. Any pointer will be appreciated.

---

<div class="post-metadata">

**Author:** ![longemen3000](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/longemen3000/32/7298_2.png) [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Post date:** [April 3, 2019, 3:35am UTC](https://discourse.julialang.org/t/function-syntax/22672/2 "2019-04-03T03:35:41Z")

</div>

here it is 😉  
[https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects-1](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects-1)

---

<div class="post-metadata">

**Author:** ![yingjerkao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yingjerkao/32/7658_2.png) [@yingjerkao](https://discourse.julialang.org/u/yingjerkao)\
**Post date:** [April 3, 2019, 3:50pm UTC](https://discourse.julialang.org/t/function-syntax/22672/3 "2019-04-03T15:50:13Z")

</div>

Thanks!
