Defining what first and rest do

class List

{

int First;

List Rest;

static int first(List L)

  {                    Î reference to a cell

  return L.First;

  }        Î qualificative

static List rest(List L)

  {

  return L.Rest;

  }

static boolean isEmpty(List L)

  {

  return L == nil;

  }

static final List nil = null;

:        Î prevents redefinition

:

}

 

To Next Slide To Previous Slide To Contents