MathGroup Archive 2005

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

Search the Archive

A ToExpression question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58316] A ToExpression question
  • From: "Ray Koopman" <koopman at sfu.ca>
  • Date: Tue, 28 Jun 2005 05:13:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

f1[x_] := Print[x];
f2[x_] := ToExpression["Print[x]"];
f3[x_] := Module[{y = x}, ToExpression["Print[y]"]];
f4[x_] :=  Block[{y = x}, ToExpression["Print[y]"]];

Scan[#[0]&,{f1,f2,f3,f4}]

0
x
y
0

Why don't f2 and f3 print 0 ?


  • Prev by Date: Smoothing Splines
  • Next by Date: False image plot
  • Previous by thread: Re: Smoothing Splines
  • Next by thread: Re: A ToExpression question