simple modules

ihab.awad at gmail.com ihab.awad at gmail.com
Tue Feb 2 13:47:02 PST 2010


On Tue, Feb 2, 2010 at 9:00 PM,  <ihab.awad at gmail.com> 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

Ihab

-- 
Ihab A.B. Awad, Palo Alto, CA


More information about the es-discuss mailing list