# {} in function names

**URL:** https://discourse.julialang.org/t/in-function-names/109240
**Category:** New to Julia
**Tags:** question
**Created:** [January 25, 2024, 8:28am UTC](https://discourse.julialang.org/t/in-function-names/109240 "2024-01-25T08:28:18Z")
**Posts on this page:** 3
**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 25, 2024, 8:28am UTC](https://discourse.julialang.org/t/in-function-names/109240/1 "2024-01-25T08:28:18Z")

</div>

I see many functions or constructors with {} in their names.

```julia
julia> NTuple{4,Int64}((1,2,3,4))
(1, 2, 3, 4)

julia> function myfun{2}(x,y)
       return x + y
       end
ERROR: UndefVarError: `myfun` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[62]:1

```

But as I tested, {} are not allowed in function names?

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [January 25, 2024, 8:34am UTC](https://discourse.julialang.org/t/in-function-names/109240/2 "2024-01-25T08:34:21Z")

</div>

Hi there!  
These are not really standard functions, they are [parametric constructors](https://docs.julialang.org/en/v1/manual/constructors/#Parametric-Constructors) for [parametric types](https://docs.julialang.org/en/v1/manual/types/#Parametric-Types).

---

<div class="post-metadata">

### Author: ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)
#### Post date: [January 25, 2024, 11:05am UTC](https://discourse.julialang.org/t/in-function-names/109240/3 "2024-01-25T11:05:24Z")

</div>

> [@gdalle](#):
>
> These are not really standard functions, they are [parametric constructors](https://docs.julialang.org/en/v1/manual/constructors/#Parametric-Constructors) for [parametric types](https://docs.julialang.org/en/v1/manual/types/#Parametric-Types).

Another way to look at constructors is as function-like objects: [Methods · The Julia Language](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects)

That is, any object may be made callable in Julia by giving it a method; giving a type a method creates a constructor. For example, these two define the same method (the second line overwrites the method defined in the first line):

```julia
NTuple{4,Int64}(x::X) = ...
(::Type{NTuple{4,Int64}})(x::X) = ...

```

PR to mention this on the Manual page for constructors: [doc: manual: constructors: note the correspondence with callable objs by nsajko · Pull Request #53051 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/53051)
