Changeset 14557


Ignore:
Timestamp:
06/22/13 19:32:46 (9 years ago)
Author:
ehuelsmann
Message:

More refactoring of shadowingImport: unbreak METATILITIES.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Package.java

    r14549 r14557  
    607607        if (sym == null)
    608608            sym = internalSymbols.get(symbol.name.toString());
    609         if (sym != null) {
    610             if (sym != symbol) {
    611                 if (shadowingSymbols != null)
    612                     shadowingSymbols.remove(symbolName);
    613                 unintern(sym);
    614             } else {
    615                 // Assert argument is already correctly a shadowing import
    616                 Debug.assertTrue(shadowingSymbols != null);
    617                 Debug.assertTrue(shadowingSymbols.get(symbolName) != null);
    618                 return;
    619             }
    620         }
    621         internalSymbols.put(symbol.name.toString(), symbol);
     609
     610        // if a different symbol with the same name is accessible,
     611        // [..] which implies that it must be uninterned if it was present
     612        if (sym != null && sym != symbol) {
     613            if (shadowingSymbols != null)
     614                shadowingSymbols.remove(symbolName);
     615            unintern(sym);
     616        }
     617
     618        if (sym == null || sym != symbol) {
     619            // there was no symbol, or we just unintered it another one
     620            // intern the new one
     621            internalSymbols.put(symbol.name.toString(), symbol);
     622        }
     623
    622624        if (shadowingSymbols == null)
    623625            shadowingSymbols = new HashMap<String,Symbol>();
    624         Debug.assertTrue(shadowingSymbols.get(symbolName) == null);
    625626        shadowingSymbols.put(symbolName, symbol);
    626627    }
Note: See TracChangeset for help on using the changeset viewer.