MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.



  • Prev by Date: Re: HoldForm
  • Next by Date: Re: HoldForm
  • Previous by thread: Re: word
  • Next by thread: Re: Seemingly strange behavior - HoldForm and Evaluate