anchor.diff:          Class:Err ->
               io:format("*** ~p:~p in ~p\n~p\n",
                         [Class, Err, Q, erlang:get_stacktrace()]),
  -            catch ice_cache:delete(),
  -            S#state{cache = clear}
  -    end.
  -
  -eval(AST, C) ->
  -    case C of
  -        clear ->
  -            ice_cache:create(),
  -            Res = ice:eval(AST),
  -            ice_cache:delete(),
  -            Res;
  -        keep ->
  -            ice:eval(AST)
  -    end.
  +            new_cache(),
  +            S
  +    end.
  +
  +new_cache() ->
  +    try ice_cache:delete() of
  +        true ->
  +            ice_cache:create()
  +    catch exit:{noproc, _} ->
  +            ice_cache:create()
  +    end.
  
positive.code:             {command, time};
          {match, ["t", Expr]} ->
              {command, {time_expr, Expr}};
          {match, ["c", OnOff]} ->
              case string:strip(OnOff) of
                  "on"++ _ ->
                      {command, cache_on};
                  "off" ++ _ ->
                      {command, cache_off};
                  _ ->
                      {command, print_cache_state}
              end;
          {match, ["l", File]} ->
              {command, {l, File}};
          {match, [C|_]} ->
  
negative.code: 
  get_name({declaration, _,
            {dim_decl, _, {id, _, Name}, _Body}= Decl}) ->
      {Name, dim, Decl};
  get_name({declaration, _,
            {var_decl, _, {id, _, Name}, _Body} = Decl}) ->
      {Name, var, Decl};
  get_name({declaration, _,
            {fun_decl, _, {id, _, Name}, _Params, _Body} = Decl}) ->
      {Name, var, Decl};
  get_name(X) ->
      throw({nodecl, expr, X}).
  
  expr_where_defs(Expr, Defs) ->
      Dims = [Def || {_Name, dim, Def} <- Defs],
      Vars = [Def || {_Name, var, Def} <- Defs ],
      ice_ast:transform([{expr, 0, {where, 0, Expr, Dims, Vars}}]).
  
  print(Defs) ->
      [io:format("~s ~s: ~p\n", [T, Name, Def]) || {Name, T, Def} <- Defs],
      ok.
  
  do_query(Q, #state{defs = Defs} = S, TC) ->
      try
          QQ = expr_where_defs(Q, Defs),
          case TC of
              no_tc ->
                  {Res, _} = ice:eval(QQ),
                  io:format("~p\n", [Res]);
              tc ->
                  {US, {R, _}} = timer:tc(ice, eval, [QQ]),
                  io:format("(~fs) ~p\n", [US/1000/1000, R])
          end,
          S
  