Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2007-04-29 18:48:47 -0700 (Sun, 29 Apr 2007)
Revision: 10559
Log message:

      Folded the "export" branch into 0.9.8.x (by hand).  It _is_ a change,
     but again, it should be invisible/backwards-compatible to normal users.
     
     The main reason for doing this is rather major, in terms of code
     structure.  With this, the type "value" is unlinked from "venv",
     so it can be pulled back all the way into src/ir.
         - This means Omake_env is no longer a bottleneck(!).
     
     This commit doesn't nothing like that.  The commit is not that major,
     but it does generalize the meaning of "export".
     
     ************************************************************************
     ** export
     
     Add export sections.
     
     * Language changes:
     
     ** Exports take effect for all sections within their static scope.
     
        section
           export
           section
              public.X = 1
     
        println($X)  # Prints 1
     
     In addition, exports augment any existing exports.
     
        section
           public.X = 1
           public.Y = 2
     
           export X
           section
              X = 3
              Y = 4
           export Y
        # X is 3
        # Y is 2         
     
     ** Variable definitions also allow exports.
     
        public.X = 1
        public.f() =
           X = 2
           export
     
        public.Y = $f
        # X is 2
        # Y is 2
     
     Note: this is not the same as imperative programming, because functions
     can always choose not to export.
     
        public.X = 1
        public.f() =
           X = 2
     
        export X
        public.Y = $f
        # X is 1
        # Y is 2
     
     In particular, the string "functions" do not export.
     
        public.X = 1
        export X
        public.f() =
           X = 2
        Y = $"$f"
        # X = 1
        # Y = 2
     
     * Implementations.
     
     ** ValEnv no longer exists.
     
     Exporting is defined explicitly for each section of code:
        - function bodies
        - sections
        - conditionals
        - foreach and friends.
     
     Export operations are explicit.
     The evaluator no longer calls add_exports after evaluating each expression.
     There is no need for cancel-export operations.
     
     Note that foreach is a simultaneous fold-map.
     
        public.A = 0
        public.B =
           foreach(i => 1 2 3)
              A = $(add $A, $i)
              add($i, 1)
              export
     
        println($"A = $A, B = $B")
        # Prints "A = 0, B = 2 3 4")

Changes  Path
+5 -4 omake-branches/0.9.8.x/lib/Pervasives.om
+1 -0 omake-branches/0.9.8.x/lib/build/Common.om
+1 -1 omake-branches/0.9.8.x/lib/build/OCaml.om
+2 -2 omake-branches/0.9.8.x/mk/make_gen
+8 -2 omake-branches/0.9.8.x/src/build/omake_build.ml
+17 -1 omake-branches/0.9.8.x/src/build/omake_builtin.ml
+6 -3 omake-branches/0.9.8.x/src/build/omake_builtin_type.ml
+32 -46 omake-branches/0.9.8.x/src/build/omake_rule.ml
+33 -35 omake-branches/0.9.8.x/src/builtin/omake_builtin_base.ml
+13 -9 omake-branches/0.9.8.x/src/builtin/omake_builtin_file.ml
+19 -11 omake-branches/0.9.8.x/src/builtin/omake_builtin_fun.ml
+90 -118 omake-branches/0.9.8.x/src/builtin/omake_builtin_io_fun.ml
+60 -84 omake-branches/0.9.8.x/src/builtin/omake_builtin_object.ml
+10 -4 omake-branches/0.9.8.x/src/builtin/omake_builtin_rule.ml
+17 -9 omake-branches/0.9.8.x/src/builtin/omake_builtin_shell.ml
+9 -6 omake-branches/0.9.8.x/src/builtin/omake_builtin_target.ml
+39 -29 omake-branches/0.9.8.x/src/env/omake_command_digest.ml
+34 -120 omake-branches/0.9.8.x/src/env/omake_env.ml
+10 -32 omake-branches/0.9.8.x/src/env/omake_env.mli
+66 -57 omake-branches/0.9.8.x/src/env/omake_ir_ast.ml
+18 -17 omake-branches/0.9.8.x/src/env/omake_ir_free_vars.ml
+16 -25 omake-branches/0.9.8.x/src/env/omake_ir_semant.ml
+200 -147 omake-branches/0.9.8.x/src/eval/omake_eval.ml
+5 -3 omake-branches/0.9.8.x/src/eval/omake_eval.mli
+0 -16 omake-branches/0.9.8.x/src/eval/omake_value.ml
+8 -11 omake-branches/0.9.8.x/src/ir/omake_ir.ml
+29 -23 omake-branches/0.9.8.x/src/ir/omake_ir_print.ml
+1 -0 omake-branches/0.9.8.x/src/ir/omake_ir_print.mli
+3 -5 omake-branches/0.9.8.x/src/ir/omake_ir_util.ml
+0 -2 omake-branches/0.9.8.x/src/main/omake_shell.ml
+14 -12 omake-branches/0.9.8.x/src/shell/omake_shell_job.ml
+1 -1 omake-branches/0.9.8.x/src/shell/omake_shell_job.mli