[wadalabfont-kit] / java / Cons.java  

View of /java/Cons.java

Parent Directory | Revision Log
Revision: 1.1.1.1 - (download) (as text) (annotate) (vendor branch)
Thu Dec 28 08:54:22 2000 UTC (23 years, 11 months ago) by ktanaka
Branch: ktanaka, MAIN
CVS Tags: SNAP-20030702, tmp, SNAP-20030624, SNAP-20030630, SNAP-20040518, HEAD
Changes since 1.1: +0 -0 lines
change to CVS wadalab font project
//
//
//

final public class Cons extends LispObject{
  LispObject carContent,cdrContent;
  Cons(LispObject carContent, LispObject cdrContent){
    this.carContent=carContent;
    this.cdrContent=cdrContent;
  }
  public int getType(){ return CONS; }
  public LispObject car(){ return carContent; }
  public LispObject cdr(){ return cdrContent; }
  public void setCar(LispObject a){ carContent=a; }
  public void setCdr(LispObject a){ cdrContent=a; }
  public String toString(){ 
    String ret="(";
    LispObject l=this;
    while(true){
      ret+=((Cons)l).car().toString();
      l=((Cons)l).cdr();
      if(l.getType()!=CONS) break;
      ret+=" ";
    }
    if(l == Symbol.nil) return ret+")";
    else return ret+" . "+l.toString()+")";
  }
}

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help