The following use of Level is documented, without any example.
Let's try some simple codes :
In[1] Level[{a, b, c}, {1}, #^2 &]
Out[1] a^2
In[2] Level[{a, b, c}, {1}, #1^2 &]
Out[2] a^2
In[3] Level[{a, b, c}, {1}, #2^2 &]
Out[3] b^2
In[4] Level[{a, b, c}, {1}, #3^2 &]
Out[4] c^2
I want a pure function like ??? in
In[4] Level[{a, b, c}, {1}, ??? &]
Out[4] {a^2,b^2,c^2}
Of course
In[5] Level[{a, b, c}, {1}, {#1^2,#2^2,#3^2} &]
works but
can it be done without directly referring to the length of the list(=3)
so that it works for arbitrary cases (more complex list and levelspec)?
Indirectly referring the length of a list is OK.
{##}^2&
. $\endgroup$Level[{a, b, c}, {0}, #^2 &]
$\endgroup$