// A RacketList is an object of any class that implements RacketList. // // Interpretation: A RacketList represents an immutable // (and possibly empty) sequence of E values, with operations // analogous to those we've been using in Racket. interface RacketList { // Is this list empty? boolean isEmpty (); // WHERE: this list is non-empty // RETURNS: first element of this list E first (); // WHERE: this list is non-empty // RETURNS: rest of this list RacketList rest (); // GIVEN: an arbitrary value x of type E // RETURNS: a list whose first element is x and whose // rest is this list RacketList cons (E x); }