[bitc-dev] Mutability, again

Jonathan S. Shapiro shap at eros-os.org
Thu Mar 24 13:46:47 PDT 2011


Pal:

It was *critical* to the example that the 's' field in the container was
*not* a reference field and therefore not a nullable field. Your analysis
relies on changing that type in a way that breaks the example.

However, there is a further syntactic problem in the example. /container/ is
a reference, so it might have been clearer if I had written it as

  let container = Container(S(5, null))  //  container-->[5, null]
     chain = S(4, &container.s)      //  chain-->[4, *]---->[5, null]
     len = S_length(chain)              // returns 2 :
 in
    container.s := S(6,S(7,null))       //  container-->[6, *]-->[7, null]
                                        //  chain-->[4, *]-->[6,*] -->[5,
null]

Note the addition of the '&' in the initialization of chain. My intention is
that this is capturing an inner reference, not a pointer.


shap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.coyotos.org/pipermail/bitc-dev/attachments/20110324/f06513e8/attachment.html 


More information about the bitc-dev mailing list