rem: list(void){nodeCount=0;rock=NULL;}
add: class list { public:  list(void){nodeCount=0;rock=NULL;}   void add (node *newNode) { newNode->next=rock; rock=newNode; nodeCount++; } node *next(void) {  node *n=rock; if (rock) { rock=rock->next; nodeCount--; }  return n; } void remove(node *toNuke) {   if (rock==toNuke) { rock=rock->next; nodeCount--; } else { bool done=false; for (struct node *cur=rock;!done && cur->next;cur=cur->next) if (cur->next==toNuke) { cur->next=toNuke->next; nodeCount--; done=true; } }   }   int count(void) {return nodeCount;} node *top(void) {return rock;}   void dump(void) { for (struct node *cur=rock;cur;cur=cur->next) { error ("list::dump: At %p, next = %p\n",cur,cur->next); } } bool ensureSane (void) { int temp=nodeCount; for (struct node *cur=rock;cur && --temp;cur=cur->next) ; if (temp<0) { error ("list::ensureSane: found too many records!\n"); return false; } if (temp>0) { error ("list::ensureSane: found too few records!\n"); return false; } return true; }  struct node *rock; int nodeCount; private: };
context: 		list(void){nodeCount=0;rock=NULL;} 