Seemingly strange behavior - HoldForm and Evaluate
- To: mathgroup at smc.vnet.net
- Subject: [mg68109] Seemingly strange behavior - HoldForm and Evaluate
- From: "Bharat Bhole" <bbhole at gmail.com>
- Date: Mon, 24 Jul 2006 00:55:53 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I came across this when answering one of the queries posted on this forum.
If I write
(1)
In: a = 2;
HoldForm[a]
Out: a
(2)
In: a=2;
HoldForm[Evaluate[a]]
Out: 2
(3) In: a=2;
b=3;
HoldForm[Evaluate[a] + Evaluate[b]]
Out: Evaluate[a] + Evaluate[b]
Example 2 seems to suggest that Evaluate works as expected, i.e., it
evaluates the expression assigns value 2 despite the HoldAll attribute of
HoldForm. However, in example 3, evaluate does not function as expected, or
may it does, but I do not understand why a and b are not assigned there
values.
Thanks,
Bharat.
- Follow-Ups:
- Re: Seemingly strange behavior - HoldForm and Evaluate
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Seemingly strange behavior - HoldForm and Evaluate