anchor.diff:                  end
               end
           end,
  +
  +    % ArgEvaluator returns fun for finding specific operation in list and evaluation
  +    % of it's args
  +    % For example:
  +    %    Specs = [#operation{name = rate, args = RateArgs}, #operation{name = time, args = TimeArgs}],
  +    %    F = ArgEvaluator(time, Specs, undefined),
  +    %    {ArgsRes, State2} = F(State1) % Evaluates TimeArgs and returns results as ArgsRes
  +    %
  +    % We use these funs in order to reevaluate some key loop parameters (like
  +    % rate) while executing loop because vars values could be changed at any
  +    % moment. So, for instance, instead of passing Rate to a loop function, we
  +    % pass function that evaluates Rate as soon as we need it.
  +
       ArgEvaluator =
           fun (Name, Spec, Default) ->
               case lists:keyfind(Name, #operation.name, Spec) of
  
positive.code: -spec eval([proplists:property()], [script_expr()], worker_state(), worker_env(), module())
      -> {script_value(), worker_state()}.
  eval(LoopSpec, Body, State, Env, WorkerProvider) ->
      Evaluator =
          fun (Expr) ->
              fun (S) ->
  
negative.code: eval_rates(#linear_rate{from_fun = FFun, to_fun = ToFun, from = OldF, to = OldT} = RateState, Done, CurTime, Time, State) ->
      {F, State1} = FFun(State),
      {T, State2} = ToFun(State1),
      % If rate changes we have to change number of "done" iterations accordingly
      NewDone =
          case {F, T} of
              {OldF, OldT} -> Done;
              {_, _} when OldF == undefined -> Done;
              {_, _} ->
                  % Calculating areas under new and old ramp graphs (which are trapeziums)
                  % Kinematic equations also could be used (S = v0*t + a*t^2/2)
                  A = F + (T - F) * CurTime / (2 * Time),
                  B = OldF + (OldT - OldF) * CurTime / (2 * Time),
                  round(Done *  A / B)
          end,
      {RateState#linear_rate{from = F, to = T}, NewDone, State2}.
  