repack

SpecialNodes repack

shown here with a tuple type that has four (possibly nested) slots.

input ports:
Name Type Description Optional

taken from tuple type

taken from tuple type

first slot of the nested input tuple

yes

taken from tuple type

taken from tuple type

second slot of the nested input tuple

yes

…​

taken from tuple type

taken from tuple type

final slot of the nested input tuple

yes

output ports:
Name Type Description Optional

output

?0

the tuple resulting from packing the slot inputs into the tuple type of the output

no

repack takes a nested input tuple, and an input value for each slot of the nested tuple. If a slot input port is unused, i.e., the input port is not connected to anything, then that slot of the input tuple is not modified; the original slot value is passed to the output. if the slot input is used, however, then it is assigned to that slot, overriding that slot in the input tuple. This is similar to the object.assign() operator in Javascript. See the example SpecialNodes/repack:

SpecialNodes repack2

The result of running this example is as follows:

SpecialNodes repack3

The highlighted link has been assigned the nested tuple type < <int a, int b> X, <int a, int b> Y >. This is a tuple of two elements. Each element is itself a tuple of two integers called a and b. The repack node takes a nested tuple of this type, and four inputs, one for each of its integer slots. Only two of the slot inputs are used. The values 5 and 6 from those two used inputs appear in the slots X.b and Y.a in the result.