anchor.diff:             end,
     lists:foldl(PutFun, Scope, maps:keys(Map)).
   
  +%% @doc Updates the value for `Key' if it is in the current scope or
  +%% any of its parent scopes.
   -spec update(any(), any(), scope()) -> scope() | not_found.
   update(Key, Value, Scope) ->
     do_update(Key, Value, Scope).
   
  +%% @doc Returns all values in the current scope and all its parent
  +%% scopes.
   -spec values(scope()) -> [any()].
   values(Scope) ->
  -  do_values([], Scope).
  +  do_values(#{}, Scope).
   
  +%% @doc Merges all mappings and returns them in a single map.
   -spec to_map(function(), scope()) -> any().
   to_map(Fun, Scope) ->
     do_to_map(Fun, #{}, Scope).
  
positive.code: -module(clj_scope).
  
  -include("clojerl.hrl").
  
negative.code:       end
    end.
  
  %% @private
  -spec do_values(map(), scope()) -> [any()].
  do_values(MergedMappings, ?NIL) ->
    maps:values(MergedMappings);
  do_values(MergedMappings, #{mappings := Mappings, parent := Parent}) ->
    do_values(maps:merge(Mappings, MergedMappings), Parent).
  