# I am unable to understand what the function below does, please help!

**URL:** <https://discourse.julialang.org/t/i-am-unable-to-understand-what-the-function-below-does-please-help/72847>\
**Category:** General Usage\
**Created:** [December 9, 2021, 6:25pm UTC](https://discourse.julialang.org/t/i-am-unable-to-understand-what-the-function-below-does-please-help/72847 "2021-12-09T18:25:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayushsengupta8](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ayushsengupta8/32/31757_2.png) [@ayushsengupta8](https://discourse.julialang.org/u/ayushsengupta8)\
**Post date:** [December 9, 2021, 6:25pm UTC](https://discourse.julialang.org/t/i-am-unable-to-understand-what-the-function-below-does-please-help/72847/1 "2021-12-09T18:25:02Z")

</div>

function include(mod::Module, path::String)

ccall(:jl\_array\_grow\_end, Cvoid, (Any, UInt), \_included\_files, UInt(1))

```
    Core.arrayset(true, _included_files, (mod, ccall(:jl_prepend_cwd, Any, (Any,), path)), arraylen(_included_files))

    Core.println(path)

    ccall(:jl_uv_flush, Nothing, (Ptr{Nothing},), Core.io_pointer(Core.stdout))

    Core.include(mod, path)
end

```

---

<div class="post-metadata">

**Author:** ![ayushsengupta8](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ayushsengupta8/32/31757_2.png) [@ayushsengupta8](https://discourse.julialang.org/u/ayushsengupta8)\
**Post date:** [December 9, 2021, 6:30pm UTC](https://discourse.julialang.org/t/i-am-unable-to-understand-what-the-function-below-does-please-help/72847/2 "2021-12-09T18:30:08Z")

</div>

Please check; the whole snippet is given here, however, I am not able to put the whole snippet in `this` format

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [December 9, 2021, 6:31pm UTC](https://discourse.julialang.org/t/i-am-unable-to-understand-what-the-function-below-does-please-help/72847/3 "2021-12-09T18:31:46Z")

</div>

Looks like a verbatim copy of `Base.include`

```julia
function include(mod::Module, path::String)
    ccall(:jl_array_grow_end, Cvoid, (Any, UInt), _included_files, UInt(1))
    Core.arrayset(true, _included_files, (mod, ccall(:jl_prepend_cwd, Any, (Any,), path)), arraylen(_included_files))
    Core.println(path)
    ccall(:jl_uv_flush, Nothing, (Ptr{Nothing},), Core.io_pointer(Core.stdout))
    Core.include(mod, path)
end

```

which loads a file and hands it over for compilation and execution to `julia` in the R(ead)E(val)P(rint)L(oop).

It calls a couple of `julia` internal C functions like `jl_array_grow_end`, `jl_prepend_cwd` and `jw_uv_flush`.
