http://julia.readthedocs.org/en/release-0.3/manual/faq/#i-passed-an-argument-x-to-a-function-modified-it-inside-that-function-but-on-the-outside-the-variable-x-is-still-unchanged-why

http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/

On Monday, June 8, 2015 at 7:34:47 AM UTC-7, [email protected] wrote:
>
> I'm currently trying to understand how functions with an exclamation mark 
> at the end work. I know the exclamation mark is just a notational point 
> however I'm currently confused at how to actually write a mutable function.
> If a = 1
>
> function add_one(a)
>     return a + 1
> end
>
> running add_one(a) twice outputs:
>     2
>     2
>
> how would I create add_one!(a) to output:
>     2
>     3
>

Reply via email to