Transferring DownValues
You can make use of the undocumented Language`ExtendedDefinition
function that underlies the Wolfram Cloud. Suppose:
cctemp[1,2] = 13;
cctemp[2,6] = 8;
cctemp[3,7] = 4;
cctemp[1,9] = 87;
Then:
Language`ExtendedDefinition[cc] = Language`ExtendedDefinition[cctemp] /. cctemp -> cc;
Finally:
DownValues[cc]
{HoldPattern[cc[1, 2]] :> 13, HoldPattern[cc[1, 9]] :> 87, HoldPattern[cc[2, 6]] :> 8, HoldPattern[cc[3, 7]] :> 4}
DownValues[cc] = DownValues[cctemp] /. cctemp -> cc;
cc @@@ {{1, 2}, {2, 6}, {3, 7}, {1, 9}}
{13, 8, 4, 87}
If cc
has some assignments that are not overridden by the assignments in cctemp
you can use
DownValues[cc] = DeleteDuplicatesBy[
Join[DownValues[cctemp], DownValues[cc]] /. cctemp -> cc, #[[1,1]]&]