How to apply a function to an expression? [duplicate]

What is the name for the function #1[#2]&?

I would call it Apply, so that Apply[Sin,2] is Sin[2], but the real Mathematica's Apply does a different thing.

• Perhaps Operate? E.g., Operate[Sin,2,0]. – Alan Sep 25 '16 at 3:37
• Nest[Sin,2,1] – george2079 Sep 25 '16 at 11:56

This would be Compose:

Compose[Sin, 2]
(* Sin[2] *)

#1[#2] &[Sin, 2]
(* Sin[2] *)

• You must have been using Mma for a long time! One cannot even get documentation for Compose any more. – Alan Sep 25 '16 at 3:23
• +1 as Compose is the closest thing we have. In the comments of (11298) there is some discussion about 1) a name for #1[#2]& or, more generally, for #1[##2]&; 2) whether Compose is a good name for that operation; and 3) the obsolescence of Compose. – WReach Sep 25 '16 at 4:53

Your function is anonymous. You can use it like this.

#1[#2]&[Sin, 30 °]


1/2

You can also give it a name.

apply = #1[#2]&;


then

apply[Sin, 30 °]


1/2