anchor.diff:        Result
     end.
   
  -format_http_call(Call) ->
  -  case Call of
  -    {_, ?MODULE, follow_link, [_,{URI,RequestType,Body,Params}], _} ->
  -      format_http_call(URI,RequestType,Body,Params)
  -  end.
  +format_http_call([_,{URI,RequestType,Body,Params}]) ->
  +  format_http_call(URI,RequestType,Body,Params).
   
   format_http_call(PreURI,RequestType,Body,Params) ->
     BodyString =
  
positive.code:       erlang:raise(Class,Reason,StackTrace)
    end.
  
  next_state_int(State,Result,Call) ->
    case Call of
      {_, ?MODULE, initialize, _, _} ->
        State#state{initialized=true};
      {_, ?MODULE, follow_link, [Link,_], _} ->
        case Result of
  	{ok,{{_,_Code,_},_Headers,_Body}} ->
  	  LinksToAdd =
  	    case response_has_body(Result) of
  	      true ->
  		JSONbody = mochijson2:decode(http_body(Result)),
  		jsg_links:extract_dynamic_links
  		  (Link,JSONbody,jsg_links:intern_object(JSONbody));
  	      _ ->
  		[]
  	    end,
  	  State#state
  	    {
  	    dynamic_links=
  	      lists:foldl
  		(fun (DLink,DLs) ->
  		     jsl_dynamic_links:add_link(DLink,DLs)
  		 end, State#state.dynamic_links, LinksToAdd)
  	   };
  	_Other ->
  	  State
        end;
      _ -> ?LOG("Call was~n~p~n",[Call]), State
    end.
  
  make_call(ExternalFunction,InternalFunction,Args) ->
  
negative.code:       erlang:raise(Class,Reason,StackTrace)
    end.
  
  postcondition_int(_State,Args,Result) ->
    case validate_call_not_error_result(Args,Result) of
      true ->
        case http_result_code(Result) of
  	200 ->
  	  validate_call_result_body(Args,Result);
  	Other ->
  	  io:format
  	    ("~n*** Error: postcondition error: for http call~n~s~nhttp responded with result code ~p, expected result code 200~n",
  	     [format_http_call(Args),Other]),
  	  false
        end;
      _ ->
        io:format("validation failed~n"),
        false
    end.
  
  validate_call_not_error_result(Args,Result) ->
    case http_result_type(Result) of
      ok ->
        true;
      {error,_Error} ->
        io:format
  	("~n*** Error: postcondition error: for http call~n~s~nhttp responded with error ~p~n",
  	 [format_http_call(Args),http_error(Result)]),
        false
    end.
  
  validate_call_result_body(Args,Result) ->
    Link = jsg_links:link_def(call_link(Args)),
    Schema = jsg_links:link_schema(call_link(Args)),
    case jsg_jsonschema:propertyValue(Link,"targetSchema") of
      undefined ->
        true;
      TargetSchema ->
        RealTargetSchema = jsg_links:get_schema(TargetSchema,Schema),
        case response_has_json_body(Result) of
  	false ->
  	  false;
  	true ->
  	  Body = http_body(Result),
  	  Validator = get_option(validator),
  	  try Validator:validate(RealTargetSchema,Body)
  	  catch _Class:Reason ->
  	      io:format
  		("~n*** Error: postcondition error: for http call~n~s~n"++
  		   "the JSON value~n~s~n"++
  		   "did not validate against the schema~n~s~n"++
  		   "due to error~n~p~n",
  		 [format_http_call(Args),
  		  Body,
  		  mochijson2:encode(RealTargetSchema),
  		  Reason]),
  	      io:format
  		("Stacktrace:~n~p~n",
  		 [erlang:get_stacktrace()]),
  	      false
  	  end
        end
    end.
  
  link_next(State,Result,Args) ->
    try make_call(next_state,fun next_state_int/3,[State,Result,Args])
    catch Class:Reason ->
        io:format
  	("Warning: next_state/3 raises exception ~p~n",
  