-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docs for immutable composite type behavior as function arguments #14801
Comments
+1 Indeed, the whole point of immutable is that you can't tell whether the value was "copied". |
So from:
Could be changed to:
|
Is the following a manifestation of this issue?
I would expect this to print "1.0", instead it prints "3.0". |
No, it is simply because |
Even if |
This line fortunately no longer appears in the docs. |
In continuation from: https://groups.google.com/d/msg/julia-users/ZjOHONlVhsQ/eUBW51B5CgAJ
The statement from the docs:
"An object with an immutable type is passed around (both in assignment statements and in function calls) by copying, whereas a mutable type is passed around by reference."
is misleading and may not always be true (see discussion posted above).
My limited understanding and discussion with people on google groups suggests that the compiler is free to either copy or reference immutables (both singular or array of composite types ).
thanks,
Nitin
The text was updated successfully, but these errors were encountered: