Essentially my question is as follow:
Define a function that takes four arguments: an integer, an approximate real number, a rational number, and a complex number. However, the order in which arguments are specified is not important. In other words, the function should accept an integer, an
approximate real number, a rational number, or a complex number as an argument at any position, but no two arguments can be of the same type. The function returns a list of the arguments in the same order as they appear in the function. Here are some examples:
h[3 + 5 I,7/3, 5.23, 11]
{3 + 5 I, 7/3 , 5.23, 11}
h[11, 7/3, 3 + 5 I, 5.23]
{11, 7/3 , 3+ 5 I, 5.23}
h[2 , 3, 4/3, 5.5]
h[2, 3, 4/3, 5.5G]
h[11/3 , 5+ 2 I, 5.2, 3 + I]
h[11/3 , 5+ 2 I, 5.2, 3 + I]
I have tried the following the first requirement is fulfilled but the second requirement i.e. no two arguments can be of the same type does not work
In[548]:= ClearAll[f, g, h, exp2, exp3]
In[549]:= SetAttributes[f, Orderless]
In[550]:= g[a_, b_, c_, d_] := Hold[{a, b, c, d}];
In[526]:= f[n_Integer, r_Real, y_Rational, z_Complex] := g[n, r, y, z];
In[551]:= h[a_, b_, c_, d_] := ReleaseHold[g[a, b, c, d]]
In[552]:= h[5.3, 3/4, 7 + I, 5]
Out[552]= {5.3, 3/4, 7 + I, 5}
In[553]:= h[5.3, 6, 7 + I, 5]
Out[553]= {5.3, 6, 7 + I, 5}