On Tue, Dec 23, 2014 at 9:11 PM, Matt Oliveri <[email protected]> wrote:
> What is the difference, in BitC? Are there any considerations for copy > compatibility besides subtyping and mutability? And the "copy" in > "copy compatibility" means shallow copy, right? After all, we can deep > copy to any mutability type we want, I'd think. I take it you mean: what is the difference between copy compatibility and subtype compatibility? So first, yes, we're referring to shallow copy. But the reason we're especially concerned with this is that this is the kind of copying that occurs at parameter passing. I may hold a top-level-const thing, you may want a mutable copy. Because it's a *copy*, that's okay. The subtype compatibility issue comes into play when we deal with references. In that case, the reference is getting copied, but the underlying content is identical. If I have a reference to mutable stuff, and you want a reference to read-only stuff, that's okay. Not because a copy is made, but because subtyping tells us so. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
