Group Abstract Group Abstract

Message Boards Message Boards

1
|
3K Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Why does Apply behave differently in these two cases?

Posted 12 years ago
POSTED BY: Freek Augustijn
2 Replies
Posted 12 years ago
POSTED BY: Freek Augustijn

The only difference between these two examples is that Plus[1, 2] evaluates to 3, while Plus[a, b] evaluates to itself.

Apply evaluates its arguments according to the standard evaluation procedure like most other functions in Mathematica.

In[1]:= Apply[Times, Plus[2, 3]]

Out[1]= 5

In[2]:= Apply[Times, Unevaluated[Plus[2, 3]]]

Out[2]= 6

See also Non-Standard Evaluation.

POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard