anchor.diff:  -export([print/2, fprint/2, safe/2]).               % interface functions
   -export([perf/0, perf/3, perf1/0, test/0, test/2]). % testing functions
   
  +%% Specs added by Discoproject based on version of trunc_io in lager by Basho.
   
   %% Returns an flattened list containing the ASCII representation of the given
   %% term.
  -fprint(T, Max) -> 
  +-spec fprint(term(), pos_integer()) -> string().
  +fprint(T, Max) ->
       {L, _} = print(T, Max),
       lists:flatten(L).
   
  -%% Same as print, but never crashes. 
  +%% Same as print, but never crashes.
   %%
   %% This is a bit of a tradeoff. Print might conceivably crash if it's
   %% asked to print something it doesn't understand, for example some new
  
positive.code: 
  list_bodyc([], _) -> {[], 0};
  list_bodyc(_, Max) when Max < 4 -> {"...", 3};
  list_bodyc([H|T], Max) -> 
      {List, Len} = print(H, Max),
      {Final, FLen} = list_bodyc(T, Max-Len-1),
      {[$,, List|Final], FLen + Len + 1};
  
negative.code: %% Returns {List, Length}
  list_body([], _) -> {[], 0};
  list_body(_, Max) when Max < 4 -> {"...", 3};
  list_body([H|T], Max) ->
      {List, Len} = print(H, Max),
      {Final, FLen} = list_bodyc(T, Max-Len-1),
      {[List|Final], FLen + Len + 1};
  