Changeset 3634


Ignore:
Timestamp:
09/09/03 12:51:36 (19 years ago)
Author:
piso
Message:

PACKAGE_INTERNAL_SYMBOLS(), PACKAGE_EXTERNAL_SYMBOLS(), PACKAGE_INHERITED_SYMBOLS()

File:
1 edited

Legend:

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

    r3414 r3634  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Package.java,v 1.40 2003-08-15 17:18:02 piso Exp $
     5 * $Id: Package.java,v 1.41 2003-09-09 12:51:36 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3131    private String name;
    3232
    33     private final HashMap internalSymbols;
    34     private final HashMap externalSymbols;
     33    private final HashMap internalSymbols = new HashMap();
     34    private final HashMap externalSymbols = new HashMap();
    3535    private HashMap shadowingSymbols;
    3636    private ArrayList nicknames;
     
    4141    {
    4242        this.name = name;
    43         internalSymbols = new HashMap();
    44         externalSymbols = new HashMap();
    4543    }
    4644
     
    4846    {
    4947        this.name = name;
    50         internalSymbols = new HashMap();
    51         externalSymbols = new HashMap();
    5248    }
    5349
     
    608604    }
    609605
     606    public synchronized LispObject PACKAGE_INTERNAL_SYMBOLS()
     607    {
     608        LispObject list = NIL;
     609        for (Iterator it = internalSymbols.values().iterator(); it.hasNext();) {
     610            Symbol symbol = (Symbol) it.next();
     611            list = new Cons(symbol, list);
     612        }
     613        return list;
     614    }
     615
     616    public synchronized LispObject PACKAGE_EXTERNAL_SYMBOLS()
     617    {
     618        LispObject list = NIL;
     619        for (Iterator it = externalSymbols.values().iterator(); it.hasNext();) {
     620            Symbol symbol = (Symbol) it.next();
     621            list = new Cons(symbol, list);
     622        }
     623        return list;
     624    }
     625
     626    public synchronized LispObject PACKAGE_INHERITED_SYMBOLS()
     627    {
     628        LispObject list = NIL;
     629        for (Iterator packageIter = useList.iterator(); packageIter.hasNext();) {
     630            Package pkg = (Package) packageIter.next();
     631            for (Iterator it = pkg.externalSymbols.values().iterator(); it.hasNext();) {
     632                Symbol symbol = (Symbol) it.next();
     633                if (shadowingSymbols != null && shadowingSymbols.get(symbol.getName()) != null)
     634                    continue;
     635                if (externalSymbols.get(symbol.getName()) == symbol)
     636                    continue;
     637                list = new Cons(symbol, list);
     638            }
     639        }
     640        return list;
     641    }
     642
    610643    public synchronized LispObject getSymbols()
    611644    {
Note: See TracChangeset for help on using the changeset viewer.