On Fri, Sep 11, 2015 at 3:44 AM, <[email protected]> wrote: > This question on Stackoverflow > http://stackoverflow.com/questions/32504524/is-value-of-xfx-unspecified-if-f-modifies-x > was asked for C++ recently. I think it makes sense to ask it for Julia, too, > given its pass-by-sharing and we-are-all-consenting-adults semantics, and I > was wondering what the answer is. Of course I can test it on an example, but > I was wondering if this detail is defined explicitly in the > specifications/docs.
In julia, every objects are passed by reference so I don't think this would be a problem. The compiler will not make a copy of an object and pass it as the argument unless it is an immutable (in which case f(x) cannot modify x). > > Thanks! >
