[Gridflow-cvs] [svn] commit: r5640 - /trunk/src/classes3.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue May 11 18:12:21 EDT 2010


Author: matju
Date: Tue May 11 18:12:21 2010
New Revision: 5640

Log:
 * [#pack]: support multi-element list in left inlet

Modified:
    trunk/src/classes3.cxx

Modified: trunk/src/classes3.cxx
==============================================================================
--- trunk/src/classes3.cxx (original)
+++ trunk/src/classes3.cxx Tue May 11 18:12:21 2010
@@ -99,7 +99,7 @@
 	\grin 1
 	\constructor (int which_dim=-1, Grid *r=0) {
 		this->which_dim = which_dim;
-		this->r=r;
+		this->r=r?r:new Grid(Dim(),int32_e,true);
 	}
 };
 
@@ -1221,7 +1221,7 @@
 	}
 	//\decl 0 cast (NumberTypeE nt) {a = new Grid(a->dim,nt);}
 	\decl void _n_set   (int inlet, float f) {
-		#define FOO(T) ((T *)*a)[inlet] = (T)f;
+		#define FOO(T) ((T *)*a)[inlet] = T(f);
 		TYPESWITCH(a->nt,FOO,);
 		#undef FOO
 	}
@@ -1232,6 +1232,11 @@
 		#define FOO(T) out->send(n,(T *)*a);
 		TYPESWITCH(a->nt,FOO,);
 		#undef FOO
+	}
+	\decl 0 list (...) {
+		if (argc>n) argc=n;
+		for (int i=0; i<argc; i++) _n_set(0,0,i,argv[i]);
+		_0_bang(0,0);
 	}
 	//\grin 0
 };



More information about the Gridflow-cvs mailing list