title: How to pass an object by reference and value in Julia?
body: <p>I know that from <a href="https://docs.julialang.org/en/v1/manual/functions/#Argument-Passing-Behavior-1" rel="noreferrer">here</a>:</p>
  
  <blockquote>
    <p>Julia function arguments follow a convention sometimes called "pass-by-sharing", which means that values are not copied when they are passed to functions. Function arguments themselves act as new variable bindings (new locations that can refer to values), but the values they refer to are identical to the passed values. Modifications to mutable values (such as Arrays) made within a function will be visible to the caller. This is the same behavior found in Scheme, most Lisps, Python, Ruby and Perl, among other dynamic languages.</p>
  </blockquote>
  
  <p>Given this, it's clear to me that to pass by reference, all you need to do is have a mutable type that you pass into a function and edit. </p>
  
  <p>My question then becomes, how can I clearly distinguish between pass by value and pass by reference? Does anyone have an example that shows a function being called twice; once with pass by reference, and once with pass by value? </p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/38936868/in-julia-functions-passed-by-reference-or-value">this post</a> which alludes to some similar ideas, but it did not fully answer my question. </p>