Function Repository Resource:

JoinMost

An operator that joins in front of its arguments the sequence of lists it is provided

Contributed by: Seth J. Chandler
 ResourceFunction["JoinMost"][list] an operator that will join the sequence of lists it encounters with list.

Details and Options

The argument(s) need not have the head List. All subsequent expressions will be joined in front of it provided they have the same head.
ResourceFunction["JoinMost"] is very similar to the resource function JoinRest:
In ResourceFunction["JoinMost"], its argument is placed last in the Join.
In the resource function JoinRest, its argument is placed first in the Join.

Examples

Basic Examples (2)

JoinMost uses Join to join its argument {3,4} with whatever else it encounters, which one may think of as "Most" of the Join:

 In[1]:=
 Out[1]=

When used with an Association as its argument, JoinMost will override key-value pairs from the sequence of lists it encounters if any of them have the same key:

 In[2]:=
 Out[2]=

Scope (3)

The operator created by JoinMost using an association can accept sequence of associations and will override key-value pairs if and only it encounters any association in the sequence with the same key:

 In[3]:=
 Out[3]=

If JoinMost has no argument, it operates as an identity on the data it is given:

 In[4]:=
 Out[4]=

If JoinMost has a sequence of associations as its argument, it will use the last value for a key it confronts in that sequence to perform the override:

 In[5]:=
 Out[5]=

Applications (1)

JoinMost can be right-composed with Counts to create an Association that coerces an answer for certain anticipated values:

 In[6]:=
 Out[6]=

Properties and Relations (2)

JoinMost works similarly to Merge with a Last combiner function:

 In[7]:=
 Out[7]=

JoinMost is very similar to the resource function JoinRest. In JoinMost, its argument is placed last in the Join; in the resource function JoinRest, its argument is placed first in the Join.

Possible Issues (1)

JoinMost, like Join, will fail to evaluate if the heads of the expressions to be joined differ from one another:

 In[8]:=
 Out[8]=

Neat Examples (1)

Why you should read code carefully before trusting the results:

 In[9]:=
 Out[9]=

Seth J. Chandler

Version History

• 1.0.0 – 24 June 2019