On Thu, Feb 12, 2015 at 3:46 AM, Matt Rice <[email protected]> wrote: > On Thu, Feb 12, 2015 at 1:22 AM, Matt Oliveri <[email protected]> wrote: >> On Thu, Feb 12, 2015 at 3:10 AM, Matt Rice <[email protected]> wrote: >>> it may be interesting to note Marc Stiegler's implementation of >>> sealer/unsealer pairs using currying and side effects, as discussed by >>> Norm here: >>> http://cap-lore.com/Languages/Synergy/OCaml.html >> >> I can't figure out why the unsealer sets content to nullObj again >> after it reads it. Does anyone know? > > in the unseal function the first content := nullObj; call seems to be > there to protect a previously unsealed value by let bar () = ();; > unseal(bar);; (calling the unsealer with a box that doesn't produce > the effect)
*sigh* I think I really butchered trying to explain this... so say if you have the box, but not the unsealer, and I have the unsealer but not the box, the first prevents us from collaborating, you first calling box() to produce the effect, me calling unseal(bar) without producing _any_ effect and retrieving the sealed value. > and I believe the 2nd call is there so that if you can cause someone > else to cause the effect, you cannot invoke their function that causes > the effect from within the filledbox () call and take their sealed > value that you do not have I think I failed to explain this well too, by not specifying the negating effect, you have a box and thus cause the effect, and unseal (causing the effect and negating the effect), I can unseal but do not have your box, you are going to allow me to call you, upon which time you will unseal the box, and presumably do some computation... Thus I can call you to cause the effect but not without calling the negating effect before you return to me. this prevents me from calling you to unseal your box, within the fillbox () call I have passed to my copy of the (same) unsealer, then reading the contents and returning it to myself. the only way for me to unseal your value is with the ability to cause the effect without the negating effect from within my copy of the unsealer _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
