Пример #1
0
 public Object get(Object key) {
   String symbol = ((String) key).intern();
   NamedValue value = pkg.lookup(symbol);
   if (value != null) {
     return value.get();
   }
   return null;
 }
Пример #2
0
 public Object put(Object key, Object value) {
   String symbol = ((String) key).intern();
   NamedValue binding = pkg.lookup(symbol);
   if (binding != null) {
     Object old = binding.get();
     binding.set(value);
     return old;
   } else {
     pkg.set(symbol, value);
     return null;
   }
 }