public Object get(Object key) { String symbol = ((String) key).intern(); NamedValue value = pkg.lookup(symbol); if (value != null) { return value.get(); } return null; }
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; } }