Given:
Map[f, {{a, f, h, m, n, k},{a, b}, {z, d, f, h, k}, {c, d, e}, {c, p}}]
I like to have a list of ordered
functions as follows:
{a = f[b], c = f[p], c = f[d, e], z = f[d, f, h, k], a = f[f, h, m, n, k]}
Clear["Global`*"];
list = {{a, f, h, m, n, k}, {a, b}, {z, d, f, h, k}, {c, d, e}, {c, p}};
HoldForm[#1 = f[##2]] & @@@ Sort[list]
or use named function.
ff[{a_, b__}] := HoldForm[a = f[b]];
{{a, f, h, m, n, k},{a, b}, {z, d, f, h, k}, {c, d, e}, {c, p}} //
Sort //
Map[ff]
a
andc
are defined twice (so the latter evaluations will replace the former ones), so it seems like you don't actually want to define these as functions, do you? $\endgroup$