# Please help understand the syntax

**URL:** <https://discourse.julialang.org/t/please-help-understand-the-syntax/64423>\
**Category:** General Usage\
**Created:** [July 10, 2021, 3:01pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423 "2021-07-10T15:01:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpkwhan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpkwhan/32/26456_2.png) [@dpkwhan](https://discourse.julialang.org/u/dpkwhan)\
**Post date:** [July 10, 2021, 3:01pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/1 "2021-07-10T15:01:34Z")

</div>

In the source code for [summarysize.jl](https://github.com/JuliaLang/julia/blob/6aaedecc447e3d8226d5027fb13d0c3cbfbfea2a/base/summarysize.jl#L11-L20)

Line 63:  
`(ss::SummarySize)(@nospecialize obj) = _summarysize(ss, obj)`

Line 88 and 89:

```julia
(::SummarySize)(obj::Symbol) = 0
(::SummarySize)(obj::SummarySize) = 0

```

Can someone help explain the syntax used here?

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [July 10, 2021, 3:06pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/2 "2021-07-10T15:06:43Z")

</div>

Let’s say you have an instance `s` of type `SummarySize` - this function definition makes it so that using `s` as a function to be called becomes possible (like `s(arg)`).

(I’ve also moved this thread to “Usage”, since it’s not really a question about how the internals of julia or its design work 🙂)

---

<div class="post-metadata">

**Author:** ![dpkwhan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpkwhan/32/26456_2.png) [@dpkwhan](https://discourse.julialang.org/u/dpkwhan)\
**Post date:** [July 10, 2021, 3:11pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/3 "2021-07-10T15:11:47Z")

</div>

@Sukera Thank you. Can you point me to the official documentation?

---

<div class="post-metadata">

**Author:** ![EP-Guy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ep-guy/32/3442_2.png) [@EP-Guy](https://discourse.julialang.org/u/EP-Guy)\
**Post date:** [July 10, 2021, 3:25pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/4 "2021-07-10T15:25:42Z")

</div>

These are called “functors” - you’ll find many questions that mention them here on Discourse.

There’s a short section of the docs that demonstrate them here: [Methods · The Julia Language](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects-1)

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [July 10, 2021, 3:28pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/5 "2021-07-10T15:28:01Z")

</div>

Another name for them in julia is “callable structs”, though I’m not sure there’s a seperate page of documentation available.

---

<div class="post-metadata">

**Author:** ![dpkwhan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpkwhan/32/26456_2.png) [@dpkwhan](https://discourse.julialang.org/u/dpkwhan)\
**Post date:** [July 10, 2021, 11:13pm UTC](https://discourse.julialang.org/t/please-help-understand-the-syntax/64423/6 "2021-07-10T23:13:12Z")

</div>

@EP-Guy This is really helpful. Thank you so much!
