I am puzzled about the use of Apply (@@). Consider

g = t;
g1 = Function @@ {t, g} 
g2 = Function[t, g]

Why does g2 differ from g1? I had thought they would be the same. But they return

Function[t, t]
Function[t, g]
  • 1
    $\begingroup$ Type: Attributes[Function] and Attributes[Apply] and you will see that only Function has the attribute "HoldAll" $\endgroup$ Jan 17, 2023 at 20:04
  • 1
    $\begingroup$ Attributes[Function] will show that Function has the attribute HoldAll. For g1, the arguments are evaluated before Function is applied. For g2 the arguments are held. $\endgroup$
    – Bob Hanlon
    Jan 17, 2023 at 20:05
  • 1
    $\begingroup$ reference.wolfram.com/language/tutorial/Evaluation.html $\endgroup$
    – Greg Hurst
    Jan 18, 2023 at 13:13
  • $\begingroup$ Thanks to all for this very helpful discussion. A corollary is that g2 = Function[t, Evaluate[2 g]]; also works $\endgroup$ Jan 18, 2023 at 21:31

1 Answer 1


As an expression, before being evaluated, this...

Function @@ {t, g} 

is actually this...

Apply[Function, List[t, g]]

Now, we start the evaluation process. The details of the exact sequence aren't all that important, but the arguments get evaluated before the rule for the head gets implemented. So, at some point we get to this...

Apply[Function, List[t, t]]

because we applied the OwnValues for g. And then so on...

On the other hand,

Function[t, g]

is sort of static already, because Function has the HoldAll attribute. So, until this expression is fed arguments, it'll just remain in this form.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.