[bitc-dev] Mutable and Const once again

Jonathan S. Shapiro shap at eros-os.com
Wed Aug 20 17:19:47 CDT 2008


On Wed, 2008-08-20 at 17:24 -0400, Swaroop Sridhar wrote:
> In the case of defunion, should the union itself be mutable only if all
> shallow fields in all legs are mutable?

Yes. This must be the case, because we cannot know which leg we will be
handed. However, we exclude the tag value for this purpose, since that
field isn't really visible in any case.

> The present rule (which says that the union is mutable if all
> constructors only have mutable fields) might not be too bad in practice.
> But, it seems unintuitive since it creates an artificial relation
> between the mutually exclusive constructor legs.

I tend to agree, but I can't generate any other sensible
interpretation...

Oh. Urk. I now see the problem, I agree that it is quite nasty, and I
need to think about it. Unfortunately I am already 30 minutes late
leaving for home, so I cannot do that right now.


shap



More information about the bitc-dev mailing list