# Unfamiliar syntax in function definition: function (arg1::type1)(arg2::type2)

**URL:** <https://discourse.julialang.org/t/unfamiliar-syntax-in-function-definition-function-arg1-type1-arg2-type2/138884>\
**Category:** General Usage\
**Tags:** question, package, functions\
**Created:** [August 18, 2026, 1:27am UTC](https://discourse.julialang.org/t/unfamiliar-syntax-in-function-definition-function-arg1-type1-arg2-type2/138884 "2026-08-18T01:27:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ducksoverip](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ducksoverip/32/31967_2.png) [@ducksoverip](https://discourse.julialang.org/u/ducksoverip)\
**Post date:** [August 18, 2026, 1:27am UTC](https://discourse.julialang.org/t/unfamiliar-syntax-in-function-definition-function-arg1-type1-arg2-type2/138884/1 "2026-08-18T01:27:54Z")

</div>

I’m testing out an unregistered, abandoned package from 2020 ([FEDVR.jl](https://github.com/jagot/FEDVR.jl)) because it looks like it might actually suit my research needs. I `dev`’d it locally, tossed the old manifest file (so it would use the latest versions of its dependencies rather than pinning them to their 2020 versions), reran the tests (they all passed) and got to work.

Poking through the source code, there’s a few functions defined with a very odd syntax, found on lines 56-92 of [basis.jl](https://github.com/jagot/FEDVR.jl/blob/master/src/basis.jl):

```julia-auto
function (basis::Basis)(x::AbstractVector)
    χ = spzeros(length(x),basecount(basis.grid))
    evaluate!(basis, x, χ)
end

```

Leaving aside what this function is supposed to do for the moment, I’m confused by the syntax, which just has two argument types in parentheses and no function name. That same source file defines a type and constructor function `Basis`, so at first I thought maybe this was a variable function name, so that I could do something like

```julia-auto
my_basis = Basis(r, n)
my_op = my_basis(x)

```

but that errors. Next I thought this was some type of strange [anonymous function](https://docs.julialang.org/en/v1/manual/functions/#man-anonymous-functions) definition, but checking the docs shows nothing like this weird double-parenthetical syntax. I’m at quite a loss here, so any insight would be appreciated.

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [August 18, 2026, 1:34am UTC](https://discourse.julialang.org/t/unfamiliar-syntax-in-function-definition-function-arg1-type1-arg2-type2/138884/2 "2026-08-18T01:34:05Z")

</div>

It’s callable-object syntax. See [Methods · The Julia Language](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects)

---

<div class="post-metadata">

**Author:** ![ducksoverip](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ducksoverip/32/31967_2.png) [@ducksoverip](https://discourse.julialang.org/u/ducksoverip)\
**Post date:** [August 18, 2026, 2:56am UTC](https://discourse.julialang.org/t/unfamiliar-syntax-in-function-definition-function-arg1-type1-arg2-type2/138884/3 "2026-08-18T02:56:18Z")

</div>

Oh, that’s weird. Thanks for pointing that out!
