# \`fill\` is dangerous :-(

**URL:** <https://discourse.julialang.org/t/fill-is-dangerous/83396>\
**Category:** Internals & Design\
**Created:** [June 27, 2022, 11:42am UTC](https://discourse.julialang.org/t/fill-is-dangerous/83396 "2022-06-27T11:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [June 27, 2022, 11:42am UTC](https://discourse.julialang.org/t/fill-is-dangerous/83396/1 "2022-06-27T11:42:24Z")

</div>

I propose to add an extra keyword argument to `fill` (and `fill!`) to specify copy instead of reference and switch to copy in Julia 2.0 🙂

While it makes sense to have call by sharing in functions, there is not much intuitions (at least for me) behind referencing the same object in `fill`… after all we are not modifying it, we “copy” it in different positions of the filled array…

---

<div class="post-metadata">

**Author:** ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)\
**Post date:** [June 27, 2022, 11:52am UTC](https://discourse.julialang.org/t/fill-is-dangerous/83396/2 "2022-06-27T11:52:20Z")

</div>

[https://github.com/JuliaLang/julia/issues/41209](https://github.com/JuliaLang/julia/issues/41209)
