package playingWithLists;

public interface SchemeList<Any> {

	// returns a new list, whose cdr is this
	// list and whose car is x.
	// Note that this list is not changed
	// by cons.
    public SchemeList<Any> cons(Any x);
    
    // returns the car of this list
    // throws a java.util.NoSuchElementException
    // if applied to "nil" (empty list)
    public Any car();
    
    // returns the cdr list of this list
    // throws a java.util.NoSuchElementException
    // if applied to "nil" (empty list)
    public SchemeList<Any> cdr();
    
    // check if this list is "nil" (empty list)
    public boolean isNil();
    
    // set the car of this list to a new value
    // throws a java.util.NoSuchElementException
    // if applied to "nil" (empty list)
    public void setCar(Any x);
    
    // set the cdr of this list to a new list
    // throws a java.util.NoSuchElementException
    // if applied to "nil" (empty list)
    public void setCdr(MySchemeList<Any> x);
	
}
