concept RemoteLister implements ILister {
  RemoteDB db;
  new HashMap<S, L> lists;
  new HashMap<S, Map> treeMaps;
  new HashMap<S, Set> treeSets;
  new HashMap<S, IVar> vars;
  
  public L getList(S name) {
    ret getList(name, ll());
  }
  
  public synchronized L getList(S name, L defaultList) {
    L l = lists.get(name);
    if (l == null) {
      lists.put(name, l = listInConcept(this, cloneList(defaultList)));
      change();
    }
    ret l;
  }
  
  public synchronized IVar getVar(S name, O defaultValue) {
    IVar v = vars.get(name);
    if (v == null) {
      vars.put(name, v = varInConcept(this, new Var));
      change();
    }
    if (!v.has() && defaultValue != null)
      v.set(defaultValue);
    ret v;
  }
  
  public synchronized Map getTreeMap(S name) {
    Map m = treeMaps.get(name);
    if (m == null) {
      treeMaps.put(name, m = mapInConcept(this, new TreeMap));
      change();
    }
    if (getOpt_raw(m, 'm) == null)
     fail("map not sane: " + className(m) + " " + struct(m));
    ret m;
  }
  
  public synchronized Set getTreeSet(S name) {
    Set m = treeSets.get(name);
    if (m == null) {
      treeSets.put(name, m = setInConcept(this, new TreeSet));
      change();
    }
    ret m;
  }  
}