Functional auditor for Cajita

[email protected]
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.