[Yhc] make_tuple for arbitrary number of elements

Christopher Lane Hinson lane at downstairspeople.org
Tue Jan 16 11:28:16 EST 2007


Hi YHC,

I'm trying to do a make_tuple of 11 elements.

Is the correct structure to do:

MAKE_NODE(ret, G_infoTuple, N_NORMAL);

...

node->args[0] = thing0
node->args[1] = thing1
node->args[2] = thing2
node->args[3] = thing3
...
node->args[10] = thing10

Then, how does the garbage collector know the number of elements?

I would have thought that it would basically have been make_array, but 
make array uses data, not args; how does data help the situation?

Finally, I would think that I would nead to heap_pushGlobal any time I 
call anything that calls heap_alloc, but not all functions do this:

Node* _primIntegerQuotRem(Node* node){
   Node* quot = _primIntegerQuot(node);
   Node* rem  = _primIntegerRem(node);
   return make_tuple(quot, rem);
}

Could the GC not be called during _primIntegerRem, and collect quot?

Thanks,
--Lane


More information about the Yhc mailing list