anchor.diff:        wait_for_destroy()
     end.
   
  -destroy() ->
  -  case whereis(?es_gloenv_pid) of
  -    Pid when is_pid(Pid) ->
  -      Pid ! {destroy, self()},
  -      receive {ok, Pid} -> ok end;
  -    undefined ->
  -      ok
  -  end.
  -
  --define(tag_var, '%var').
  -
  -get_var(Name) ->
  -  case lookup(Name, ?tag_var) of
  -    {value, Value} -> Value;
  -    none -> throw({unbound_variable, Name})
  -  end.
  -
  -enter_var(Name, Value) -> insert(Name, ?tag_var, Value).
  -
  -lookup(Name, Tag) ->
  +-spec lookup(term()) -> {atom(), term()} | none.
  +lookup(Name) ->
     try
  -    {value, ets:lookup_element(?es_gloenv_tab, {Name, Tag}, 2)}
  +    ets:lookup_element(?es_gloenv_tab, Name, 2)
     catch
       error:badarg -> none
     end.
  -
  -insert(Name, Tag, Val) ->
  -  ets:insert(?es_gloenv_tab, {{Name, Tag}, Val}).
  
positive.code: %%%
  %%% es_gloenv.erl
  %%%
  %%% Global {Name,Tag} -> Value store for ErlScheme.
  %%% Used for global variables, and macro and syntax bindings.
  
  -module(es_gloenv).
  
  -export([init/0,
  	 destroy/0,
  	 get_var/1,
  	 enter_var/2,
  	 lookup/2,
  	 insert/3]).
  
  -define(es_gloenv_tab, es_gloenv_tab).
  -define(es_gloenv_pid, es_gloenv_pid).
  
  init() ->
    case ets:info(?es_gloenv_tab, type) of
      set ->
        ok;
      undefined ->
        Self = self(),
        %% XXX: monitoring here?
        P = spawn(fun () -> do_init(Self) end),
        receive {ok, P} -> ok end
    end.
  
  do_init(Pid) ->
    erlang:register(?es_gloenv_pid, self()),
  
negative.code: %%% -*- erlang-indent-level: 2 -*-
  %%%
  %%%   Copyright 2014-2022 Mikael Pettersson
  %%%
  %%%   Licensed under the Apache License, Version 2.0 (the "License");
  %%%   you may not use this file except in compliance with the License.
  