Conversation
|
FWIW, I remember Jeff being opposed to having a julia> copy((1,2))
ERROR: MethodError: no method matching copy(::Tuple{Int64,Int64}) |
|
I think this is a better example: julia> copy(1:2)
1:2 |
With using |
|
Ah I didn't realise julia> copy(x) === x
true
julia> BigFloat(1) === BigFloat(1)
falsePerhaps I should just do a standard |
|
If you want to make sure that mutating a |
|
|
|
¯\_(ツ)_/¯ |
|
BigFloat is supposed to be semantically immutable but their implementation doesn't let us do that now.
|
|
I don’t think it actually solves a problem. I’m inclined to change it to copy(d::Domain) = d |
|
Isn't defining copy(d::Domain) = isbits(d) ? d : deepcopy(d) |
|
You are certainly right, at least in theory. In practice, I can’t think of a case where it matters. But for the sake of not intentionally writing “bad“ code I’ll make that change and only override for |
This PR adds a copy method. The easiest way to do this was to call
deepcopy, @ararslan @timholy is there any hidden issue in doing this?