On Tue, Feb 2, 2010 at 4:47 PM,  <[email protected]> wrote:
> On Tue, Feb 2, 2010 at 9:00 PM,  <[email protected]> wrote:
>> Create a context that allows *only* transitively immutable modules.
>
> And the static rules for making this work could be to *only* allow
> top-level function definitions in the module, and freeze the exports
> before returning them. So:
>
>    /* an ocap module must look like this */
>    export function pointCartesian(x, y) { ... };
>    export function pointPolar(r, t) { ... };
>
> but:
>
>    /* these are statically disallowed in an ocap module */
>    var x = 3;
>    const y = 4; // to be conservative
>    export var z = 5;
>    export const t = 3; // to be conservative

Note that disallowing const bindings is required, not just being
conservative, since const doesn't mean deeply immutable.
-- 
sam th
[email protected]
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to