#ifndef LIST_H #define LIST_H #pragma interface #include "value.h" #include <String.h> class Val_List { friend class Value; friend class Object_Store; friend class Frame; friend class Subrange; protected: Value *elem; Val_List* next; public: String* tostr(); String* format(int tab, int columns); void cat (Val_List*); Val_List* copy (); Val_List* copy_some (int length); int compare (Val_List* inlist);/* returns -1 if this is an initial subset of * inlist returns 0 if the lists are identical * returns 1 if inlist is an initial subset of * this returns INT_MIN if lists are totally * different */ int length (); Value* nth (int i); Val_List* insert (Value* someval , int pos); int ok_command(); int ok_clause(); Val_List* command_match (String&); String* command_match_OR (String&); char* pack_list (char* buf); void ensure_clean (); Val_List(Value* first_element, Val_List* cdr = NULL); ~Val_List (); int search (Value* key, Val_List* key_as_list = NULL); /* returns the position in the list if 'key' is */ /* located in the list */ /* doesn't allow searches for lists in lists */ }; #endif /* LIST_H */