anchor.diff:  %% clojerl.IAssociative
   
   contains_key(#{?TYPE := ?M, array := Array}, Index) ->
  -  Index >= 0 andalso Index < array:size(Array).
  +  is_valid_index(Array, Index).
   
   entry_at(#{?TYPE := ?M, array := Array}, Index) ->
  -  array:get(Index, Array).
  +  case is_valid_index(Array, Index) of
  +    true  -> ?CONSTRUCTOR([Index, array:get(Index, Array)]);
  +    false -> ?NIL
  +  end.
   
   assoc(#{?TYPE := ?M, array := Array} = Vector, Index, Value) ->
  -  case  Index =< array:size(Array) of
  +  case is_valid_index(Array, Index) orelse Index == array:size(Array) of
       true  -> Vector#{array => array:set(Index, Value, Array)};
  -    false -> error(<<"Index out of bounds">>)
  +    false -> ?ERROR(<<"Index out of bounds">>)
     end.
   
   %% clojerl.ICounted
  
positive.code: 
  %% clojerl.IFn
  
  apply(#{?TYPE := ?M, array := Array}, [Index]) ->
    array:get(Index, Array);
  apply(#{?TYPE := ?M}, Args) ->
    CountBin = integer_to_binary(length(Args)),
    throw(<<"Wrong number of args for vector, got: ", CountBin/binary>>).
  
  %% clojerl.IHash
  
  
negative.code: 
  str(#{?TYPE := ?M} = Vector) ->
    clj_rt:print_str(Vector).
  
  %%------------------------------------------------------------------------------
  %% Helper functions
  %%------------------------------------------------------------------------------
  
  is_valid_index(Array, Index) ->
    is_integer(Index) andalso Index >= 0 andalso Index < array:size(Array).
  