Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2005-07-03 07:13:42 -0700 (Sun, 03 Jul 2005)
Revision: 1182
Log message:

      Experimenting with variable scoping.
      
      This was an attempt to delay variable linking until runtime,
      which is desirable because you would like to have computed
      opens.
      
          open $(STDLIB)/foo
          X = 1
      
      It doesn't really work because when the definition of X is encountered
      at parse time, it isn't known what module it belongs to.  Since it isn't
      known, the variable summary for this file can't be computed.
      
      There are two solutions.
      
         1. Make the open static, so scoping can be determined
            at parse time.
      
               # Find foo using the static search path
               open foo
      
            This is the way most languages do it, but it is
            unsatisfying for omake.
      
         2. Keep dynamic opens, and keep a linkage section for each
            file that can be computed without evaluating the entire
            file.  It gets a little messy because of nested opens,
            but the nice thing is that opens are statically scoped,
            so nested opens do not affect the top-level definitions.
      
               open $(A)
               # link X, Y
      
               if blah
                  X = 1
                  export
               else
                  open $(B)
                  # link Y
      
                  Y = 1
                  export
      
               println($(Y))
      
      I'll try doing 2.
      

Changes  Path
+9 -3 omake-branches/strictscope1/src/env/omake_command_digest.ml
+115 -111 omake-branches/strictscope1/src/env/omake_env.ml
+30 -34 omake-branches/strictscope1/src/env/omake_env.mli
+8 -4 omake-branches/strictscope1/src/env/omake_ir_ast.ml
+2 -11 omake-branches/strictscope1/src/env/omake_ir_ast.mli
+60 -70 omake-branches/strictscope1/src/env/omake_ir_free_vars.ml
+1 -1 omake-branches/strictscope1/src/env/omake_ir_free_vars.mli
+4 -4 omake-branches/strictscope1/src/env/omake_ir_semant.ml
+7 -7 omake-branches/strictscope1/src/eval/omake_eval.ml
+0 -2 omake-branches/strictscope1/src/eval/omake_eval.mli
+30 -31 omake-branches/strictscope1/src/ir/omake_ir.ml
+45 -76 omake-branches/strictscope1/src/ir/omake_ir_print.ml
+1 -1 omake-branches/strictscope1/src/ir/omake_ir_print.mli
+5 -7 omake-branches/strictscope1/src/ir/omake_ir_util.ml