Re: Re: Is this a bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg13463] Re: Re: Is this a bug?
- From: bruck at math.usc.edu (Ronald Bruck)
- Date: Sun, 26 Jul 1998 02:33:28 -0400
- Organization: University of Southern California, Los Angeles, CA
- References: <6p97ac$b5u@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <6p97ac$b5u at smc.vnet.net>, <jfreeze at lexmark.com> wrote: :Thanks for all of the responses. My original question was (basically) :why does :If[True, Evaluate[x=5], Evaluate[y=5]] give :{x,y} as {5,5}. :It was explained by several people that the reason is that Evaluate :overides HoldRest. :Nevertheless, it seems to me that expressions not returned from If :should not be executed, :regardless if Evaluate is used. : The real question is, WHY did you wrap the Evaluate around these expressions? As has been pointed out, the whole REASON for Evaluate is to change the order of evaluation. It's not something you should do without thinking hard about it. (Well, OK, I usually test it in simple cases, both with and without. Doing is easier than thinking :-) Your complaint seems to be that the syntax isn't C-like. But it is; Evaluate is provided as an EXCEPTION. And it took me all of one minute to browse the help files and figure out what had happened. --Ron Bruck