basix_doc 0.1
/Users/mourrain/Devel/mmx/basix/glue/glue_list_generic.cpp
Go to the documentation of this file.
00001 
00002 #include <basix/list.hpp>
00003 #include <basix/tuple.hpp>
00004 #include <basix/alias.hpp>
00005 #include <basix/glue.hpp>
00006 
00007 namespace mmx {
00008   static bool
00009   GLUE_1 (const generic &arg_1) {
00010     return is_list (arg_1);
00011   }
00012   
00013   static list<generic>
00014   GLUE_2 (const tuple<generic> &arg_1) {
00015     return list<generic > (as_vector (arg_1));
00016   }
00017   
00018   static iterator<generic>
00019   GLUE_3 (const list<generic> &arg_1) {
00020     return iterate (arg_1);
00021   }
00022   
00023   static int
00024   GLUE_4 (const list<generic> &arg_1) {
00025     return N (arg_1);
00026   }
00027   
00028   static generic
00029   GLUE_5 (const list<generic> &arg_1, const int &arg_2) {
00030     return arg_1[arg_2];
00031   }
00032   
00033   static alias<generic>
00034   GLUE_6 (const alias<list<generic> > &arg_1, const int &arg_2) {
00035     return alias_access<generic > (arg_1, arg_2);
00036   }
00037   
00038   static list<generic>
00039   GLUE_7 (const list<generic> &arg_1, const int &arg_2, const int &arg_3) {
00040     return range (arg_1, arg_2, arg_3);
00041   }
00042   
00043   static list<generic>
00044   GLUE_8 (const list<generic> &arg_1) {
00045     return reverse (arg_1);
00046   }
00047   
00048   static list<generic>
00049   GLUE_9 (const list<generic> &arg_1, const list<generic> &arg_2) {
00050     return append (arg_1, arg_2);
00051   }
00052   
00053   static list<generic>
00054   GLUE_10 (const generic &arg_1, const list<generic> &arg_2) {
00055     return cons (arg_1, arg_2);
00056   }
00057   
00058   static generic
00059   GLUE_11 (const list<generic> &arg_1) {
00060     return car (arg_1);
00061   }
00062   
00063   static list<generic>
00064   GLUE_12 (const list<generic> &arg_1) {
00065     return cdr (arg_1);
00066   }
00067   
00068   static bool
00069   GLUE_13 (const list<generic> &arg_1) {
00070     return is_nil (arg_1);
00071   }
00072   
00073   static bool
00074   GLUE_14 (const list<generic> &arg_1) {
00075     return is_atom (arg_1);
00076   }
00077   
00078   static list<generic>
00079   GLUE_15 (const list<generic> &arg_1, const generic &arg_2) {
00080     return insert (arg_1, arg_2);
00081   }
00082   
00083   static int
00084   GLUE_16 (const list<generic> &arg_1, const generic &arg_2) {
00085     return find (arg_1, arg_2);
00086   }
00087   
00088   static bool
00089   GLUE_17 (const list<generic> &arg_1, const generic &arg_2) {
00090     return contains (arg_1, arg_2);
00091   }
00092   
00093   void
00094   glue_list_generic () {
00095     static bool done = false;
00096     if (done) return;
00097     done = true;
00098     call_glue (string ("glue_generic"));
00099     define_type<list<generic> > (gen (lit ("List"), lit ("Generic")));
00100     define ("list?", GLUE_1);
00101     define ("list", GLUE_2);
00102     define_converter (":>", GLUE_3, PENALTY_PROMOTE_GENERIC);
00103     define ("#", GLUE_4);
00104     define (".[]", GLUE_5);
00105     define (".[]", GLUE_6);
00106     define (".[]", GLUE_7);
00107     define ("reverse", GLUE_8);
00108     define ("><", GLUE_9);
00109     define ("cons", GLUE_10);
00110     define ("car", GLUE_11);
00111     define ("cdr", GLUE_12);
00112     define ("nil?", GLUE_13);
00113     define ("atom?", GLUE_14);
00114     define ("insert", GLUE_15);
00115     define ("find", GLUE_16);
00116     define ("contains?", GLUE_17);
00117   }
00118 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines