Wolfram Computation Meets Knowledge

JoinTo

Contributed by: Richard Hennigan (Wolfram Research)

Equivalent to Join, but redefines the first argument to the result

ResourceFunction["JoinTo"][expr,list1,list2,]

equivalent to Join[expr,list1,list2,] but sets expr to the result.

ResourceFunction["JoinTo"][expr,list1,list2,,n]

joins the objects at level n in each of the expr,list1,list2,.

Details and Options

The listi and expr do not need to have head List, but must all have the same head.

Examples

Basic Examples

Join some lists:

In[1]:=
expr = {a, b, c};
ResourceFunction["JoinTo"][expr, {x, y}, {u, v, w}]
Out[2]=

The value of expr has changed:

In[3]:=
expr
Out[3]=

JoinTo works with associations:

In[4]:=
assoc = <|"a" -> 1|>;
ResourceFunction["JoinTo"][assoc, <|"b" -> 2, "c" -> 3|>]
Out[5]=
In[6]:=
assoc
Out[6]=

Resource History