# Reading Flux code base

**URL:** <https://discourse.julialang.org/t/reading-flux-code-base/28387>\
**Category:** New to Julia\
**Created:** [September 4, 2019, 8:08pm UTC](https://discourse.julialang.org/t/reading-flux-code-base/28387 "2019-09-04T20:08:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadir-gunel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kadir-gunel/32/35790_2.png) [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Post date:** [September 4, 2019, 8:08pm UTC](https://discourse.julialang.org/t/reading-flux-code-base/28387/1 "2019-09-04T20:08:49Z")

</div>

Dear all,

I am trying to learn how to write good and efficient Julian code and Flux seems to be a good starting point. Due to that I started to read Flux code base and immediately, under src/layers/basic.jl, a code snippet caught my eye :

```julia
struct Chain{T<:Tuple}
  layers::T
  Chain(xs...) = new{typeof(xs)}(xs) # new ?
end

```

Could anybody explain how exactly the `new` works? I do not get it because there is no new keyword in Julia as far as I know and the package did not import anything from other packagaes then how ?

B.R.

---

<div class="post-metadata">

**Author:** ![lbilli](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lbilli](https://discourse.julialang.org/u/lbilli)\
**Post date:** [September 4, 2019, 8:16pm UTC](https://discourse.julialang.org/t/reading-flux-code-base/28387/2 "2019-09-04T20:16:14Z")

</div>

You might want to read the docs about [Inner Constructors](https://docs.julialang.org/en/v1/manual/constructors/#Inner-Constructor-Methods-1).

---

<div class="post-metadata">

**Author:** ![kadir-gunel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kadir-gunel/32/35790_2.png) [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Post date:** [September 5, 2019, 7:19am UTC](https://discourse.julialang.org/t/reading-flux-code-base/28387/3 "2019-09-05T07:19:27Z")

</div>

Thank you, now I got it .
