#include "repetition.h"

#ifndef GENERICH
#include <generic.h>
#endif

#define list(type) name2(type,list_)
#define list_iterator(type) name2(type,list_iterator)

#define listdeclare(type)						\
struct list(type) : repetition {					\
  	list(type)() {}							\
  	list(type)( type a ) : (ent( a ) ) {}			        \
       ~list(type)() {} 						\
  int	insert( type a) { return repetition::insert( ent(a) ); }	\
  int	append( type a) { return repetition::append( ent(a) ); }	\
  type	get() { return type( repetition::get() ); }			\
  int	list_length() { return repetition::list_length(); }		\
  type	car() { return type( repetition::car() ); }			\
  void	cdr() { repetition::cdr(); }					\
  type	lastexp() { return type (repetition::lastexp() ); }		\
  type	n_th( int a ) { return type (repetition::n_th(a) ); }		\
  int	conc(ent a, ent b) { return repetition::conc(a,b); }		\
  int   concatenate( list(type) *lst )					\
	      { return repetition::concatenate( (repetition *)lst ); }	\
};									\
									\
struct list_iterator(type) : repetition_iterator {			\
  list_iterator(type)							\
    ( list(type) &s ) : ( (repetition &) s ) {}				\
  type operator()() 							\
     { return type( repetition_iterator::operator()() ); } 		\
};


