2 cons.hh -- declare LISP like datatypes
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
37 class Killing_cons : public Cons<T>
40 Killing_cons (T *t, Cons<T> *p)
44 virtual ~Killing_cons ();
48 /// remove the link pointed to by *p.
50 Cons<T> *remove_cons (Cons<T> **pp)
62 (*tail_) is either the head_ pointer, or a next_ pointer from the list.
73 Cons_list () { init_list (); }
74 void init_list () {head_ =0; tail_ = &head_; }
75 void append (Cons<T> *c)
80 tail_ = &(*tail_)->next_;
83 PRE: *pp should either be the head_ pointer, or the next_ pointer
86 Cons<T> *remove_cons (Cons<T> **pp)
88 if (&(*pp)->next_ == tail_)
91 return ::remove_cons (pp);
98 ~Cons_list () { junk (); }
103 void copy_killing_cons_list (Cons_list<T>&, Cons<T> *src);
106 clone_killing_cons_list (Cons_list<T>&, Cons<T> *src);
108 template<class T> int cons_list_size_i (Cons<T> *l)