6 Tuple *Tuple_calloc(int arity) {
7 Tuple *t = (Tuple *) malloc( sizeof( Tuple ) + arity * sizeof( void* ) );
9 memset( t->elements, 0, arity * sizeof( void* ) );
14 Tuple *Tuple_create(int arity,...) {
17 Tuple *t = (Tuple *) malloc( sizeof( Tuple ) + arity * sizeof( void* ) );
18 t->types = 0; // unknown types
19 va_start( ap, arity );
20 for ( i = 0; i < arity; i++ ) {
21 t->elements[i] = va_arg( ap, void* );
27 Tuple *Tuple_clone(int arity,Tuple *t) {
28 Tuple *ct = (Tuple *)malloc( sizeof( Tuple ) + arity * sizeof( void* ) );
29 memcpy( ct, t, arity * sizeof( void* ) );
34 unsigned long Tuple_mask(int arity,Tuple *t) {
35 unsigned long mask = 0;
36 while ( arity-- > 0 ) {
38 if ( t->elements[ arity ] ) {