# Make function paramaters immutable by default

**URL:** <https://discourse.julialang.org/t/make-function-paramaters-immutable-by-default/3611>\
**Category:** Internals & Design\
**Tags:** proposal\
**Created:** [May 9, 2017, 8:02am UTC](https://discourse.julialang.org/t/make-function-paramaters-immutable-by-default/3611 "2017-05-09T08:02:49Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [May 10, 2017, 12:36pm UTC](https://discourse.julialang.org/t/make-function-paramaters-immutable-by-default/3611/31 "2017-05-10T12:36:33Z")

</div>

> [@dfdx](#):
>
> Why then you need a special attribute to mark modifiable parameters?

Because that would allow me to write an `@parallelize` macro that would work on 99.9 % of the code that I would want it to work on. (And I wouldn’t use it on the remaining 0.1 %.) I deal with a lot of code that has no side effect, no global variables, and no parameter aliasing. (Much of it auto-generated. None of it in julia at the moment, but I’m hoping for that to change.) I can’t just run everything in `@parallel`. I need a macro that figures out which functions must wait for other functions to finish, given the above-mentioned properties.

But the hypothetical `@parallelize` macro is really not the issue here. The point is to have a programmatic way of telling which, if any, of its parameters that a function is intended to modify. This can be used for anything from syntax highlighting and data flow visualizations to unit testing. How many of the julia functions that are not intended to modify their mutable inputs currently have unit tests that verify that they really don’t?

---

_[View the full topic](https://discourse.julialang.org/t/make-function-paramaters-immutable-by-default/3611)._
