Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Is this a bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13386] Re: Is this a bug?
  • From: jfreeze at lexmark.com
  • Date: Thu, 23 Jul 1998 03:32:32 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

The following seems to be a bug. In the first example, both the true and
the false parts of If are being evaluated. In the secon example, only
the true part. If this is not a bug, could someone please explain this
behavior to me. Thanks

In[1]:=
     Clear[x,y];
    
If[True,Evaluate[ToExpression["x=5"]],Evaluate[ToExpression["y=5"]]];
     Print[x,y];
Out[1]:=
     55
In[2]:=
     Clear[x,y];
     If[True,x=5,y=5];
     Print[x,y];
Out[2]:=
     5y



  • Prev by Date: Re: Conditions on patterns in Flat functions
  • Next by Date: discrete math, how many zeroes in 125!
  • Previous by thread: Re: Erroneous ImageSize?
  • Next by thread: Re: Re: Is this a bug?