# Syntax of types with "new" in constructors, where is it described?

**URL:** <https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652>\
**Category:** General Usage\
**Tags:** documentation\
**Created:** [September 3, 2021, 2:40pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652 "2021-09-03T14:40:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 3, 2021, 2:40pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652/1 "2021-09-03T14:40:22Z")

</div>

I ran into the issue described in [How to resolve `syntax: too few type parameters specified in &ldquo;new{&hellip;}&rdquo;`?](https://discourse.julialang.org/t/how-to-resolve-syntax-too-few-type-parameters-specified-in-new/15766) yesterday and for the life of me I can’t find anywhere in the documentation where the syntax new{A,B,C} is even mentioned/used much less described in the documentation.

Is there something I missed? or does the documentation need a pull request to include some description of how this works?

Where I looked:  
The keyword “new” is described here: [Essentials · The Julia Language](https://docs.julialang.org/en/v1/base/base/#new)

and it refers you to here:  
[https://docs.julialang.org/en/v1/manual/constructors/#man-inner-constructor-methods](https://docs.julialang.org/en/v1/manual/constructors/#man-inner-constructor-methods)

I guess at the very bottom of that page is a mention of new{A,B} but it’s pretty sparse on details. It seems useful to have something right in the section labeled “Parametric Constructors”

---

<div class="post-metadata">

**Author:** ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Post date:** [September 3, 2021, 4:20pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652/2 "2021-09-03T16:20:02Z")

</div>

It does seem to be under-documented.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 3, 2021, 4:51pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652/3 "2021-09-03T16:51:18Z")

</div>

Documentation is something I could potentially provide a pull request for without a major problem.

I’m thinking the docstring on “new” should say:

```julia
  new, or new{A,B,...}

  Special function available to inner constructors which creates a new object
  of the type. The form new{A,B,...} calls out the types explicitly similar to a constructor
  for a struct such as Array{Int,1}. See the manual section on Inner Constructor Methods for more
  information.

```

or something like that. Then in the section on Parametric Constructors, any suggestions?

---

<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:** [September 3, 2021, 4:55pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652/4 "2021-09-03T16:55:52Z")

</div>

Nice idea!

I’d drop the “similar” part though, as `new` is reserved for inside of inner constructors and per se has nothing to do with how a parametric type is written - just that the “type parameters” in `new{..}` define how the constructed object is parametrized.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [September 3, 2021, 6:37pm UTC](https://discourse.julialang.org/t/syntax-of-types-with-new-in-constructors-where-is-it-described/67652/5 "2021-09-03T18:37:21Z")

</div>

ok, I opened a PR with this edit for the “new” docs
