Who has examples they like of ways to control Deep Copy operations so that they don't go crazy and copy too much stuff by accident, and it takes you a long time to notice (or maybe you never notice)?
-
-
Replying to @Jonathan_Blow
I’m fond Rusts semantics for this. Your custom types have to explicitly declare copy or clone. And you can’t do either if they aren’t declared. Copy can also only be derived for types where all internal structures are themselves copyable etc.
1 reply 0 retweets 6 likes -
Replying to @BigBobGardner @Jonathan_Blow
And then your functions can say “take x where x is copy” and now that strict you don’t want copying can’t be passed to a function that’s gonna try to.
1 reply 0 retweets 0 likes -
Replying to @BigBobGardner @Jonathan_Blow
To be more specific you then don’t implement copy for certain language intrinsics. Like say list, stack, queue, ptr etc. that way if the user wants to copy them they must explicitly implement a copy function. At that point the developer has specified intent and is let them.
1 reply 0 retweets 0 likes
This is impractical and not really helpful .. basically the same as C++.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.