[e-lang] Functional auditor for Cajita
ihab.awad at gmail.com
ihab.awad at gmail.com
Mon Dec 7 19:00:51 PST 2009
Hi folks,
Here is a proposal for a Cajita auditor for purely functional values:
1. All transitively frozen JSON values are functional.
2. All function values are born frozen, so they are functional *as values*.
3. The compiler can conservatively annotate certain functions as
purely functional. This will miss some cases, but again, this is
conservative. Perhaps we can add some annotation for programmers to
ask the compiler to treat failure to verify as an error, like:
var f = /*@functional*/ function(x, y) { ... };
4. At runtime, any frozen data structure containing only functional
values as described above can pass a functional auditor, and the
decision can be memoized on the value.
Does this work?
Ihab
--
Ihab A.B. Awad, Palo Alto, CA
More information about the e-lang
mailing list