On Thu, Mar 24, 2011 at 7:14 AM, Sandro Magi <[email protected]>wrote:
> On 23/03/2011 5:56 PM, Jonathan S. Shapiro wrote: > > Among other consequences, this means that in a language having init-only > > fields and inner-references, a structure consisting exclusively of > > init-only fields is not necessarily pure... > > I'm not sure the example implies this conclusion. 'Container' clearly is > not init-only. Is it really surprising that introducing mutability > anywhere in a path means the purity of our immutable structures changes? > I agree that it's not surprising. What *is* surprising is that a structure consisting entirely of init-only fields may not be pure. It's surprising in the sense that it will lead programmers to surprising outcomes. > The example you provided is a hazard of working with any sort of > mutability, and I wouldn't fret over it. Either we care about a pure programming model or we don't. If we do, then we need to be clear about the conditions under which purity is enforced. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
