anchor.diff:        tcache_stop(Pid)
     end.
   
  +eval(S) ->
  +  {ok, T} = tea:string(S),
  +  tea:eval(T).
  +
   %% End of Module.
  
positive.code:       end
      end
      var A = B // Outer A
    end
  end"),
    ?assertError({badmatch, hang}, tea:eval(T)).
  
  var_redefined_in_nested_wherevar_is_shadowed_by_outer_if_outer_already_queried() ->
    {ok, T} = tea:string("
  A
  where
    var B = 46
    var C =
      if B == 46 then // Force evaluation of B
        D
        where
          var B = 58 // Programmer intends to shadow outer B
          var D = B
        end
      else
        1
      fi
    var A = C
  end"),
    ?assertMatch({46, _}, tea:eval(T)).
  
  %% Internals
  
  
negative.code:    _Setup = fun() -> {ok, Pid} = tcache:start_link(100), Pid end,
     _Cleanup = fun(Pid) -> tcache_stop(Pid) end,
     [
      ?_assertMatch({46,_},
                    eval(basic())),
      ?_assertMatch({46,_},
                    eval(var_can_refer_to_var_defined_above_in_same_wherevar())),
      ?_assertMatch({46,_},
                    eval(var_can_refer_to_var_defined_below_in_same_wherevar())),
      ?_assertMatch({58, _}, %% FIXME This should give a compile error "Error, var A already defined."
                    eval(var_cannot_be_redefined_in_same_wherevar())),
      ?_assertError({badmatch, hang}, %% Shall therefore wherevar be used at all?
                    eval(var_redefined_in_nested_wherevar_hangs_cache())),
      ?_assertError({badmatch, hang}, %% idem as above
                    eval(var_redefined_in_nested_wherevar_hangs_cache2())),
      ?_assertError({badmatch, hang}, %% idem as above
                    eval(var_redefined_in_nested_wherevar_hangs_cache3())),
      ?_assertMatch({46,_}, %% This is really confusing for the programmer
                    eval(var_redefined_in_nested_wherevar_is_shadowed_by_outer_if_outer_already_queried()))
     ]}.
  
  basic() ->
    "A
    where
      var A = 46
    end".
  
  var_can_refer_to_var_defined_above_in_same_wherevar() ->
    "A
    where
      var B = 46
      var A = B
    end".
  
  var_can_refer_to_var_defined_below_in_same_wherevar() ->
    "A
    where
      var A = B
      var B = 46
    end".
  
  var_cannot_be_redefined_in_same_wherevar() ->
    "A
    where
      var A = 46
      var A = 58
    end".
  
  var_redefined_in_nested_wherevar_hangs_cache() ->
    "A
    where
      var B = C
      where
        var A = 46 // Inner A
        var C = A
      end
      var A = B // Outer A
    end".
  
  var_redefined_in_nested_wherevar_hangs_cache2() ->
    "A
    where
      var B = C
      where
  