[Date Index] [Thread Index] [Author Index]
Re: Re: Reevaluation of conditional arguments when the condition has changed
albert wrote: > Hi Igor, > > >>You shouldn't expect it because you're using the Set function (=). When >>you call: >> >>expr1 = foo[a b] >> >>It evaluates the rhs (giving "foo[a b]") and sets that *value* to the >>value of >>expr1. Note it's *not* the function definition foo[a b], but it's value. >>Its value just happened to be the "unevaluated value", but it's still its >>value. When you modify the foo function and reevaluate expr1 (I'm assuming >>you're simply doing "expr1" in a new cell), you're simply getting that >>value that was stored in the variable. >> >>That is the whole idea behind using Set vs. SetDelayed ( := ) > > > I don't agree, otherwise the following would be a bug: > > In:= a=b > > Out= b > > In:= b=1 > > Out= 1 > > In:= a > > Out= 1 > > I think the difference between Set and SetDelayed is not the point in what > David asked and I also guess that he is very aware of that difference. The > question is whether the observation he made is an indiaction of a bug or > not. I think it is a bug, even though Carl Woll has posted a workaround and > that makes it not a severe problem. Maybe it would be a good idea to at > least mention the use of UpValues as one of the possible "special > circumstances" in the Update help. On the other hand, the usage of UpValues > doesn't seem to be so special after all... > > albert I stand corrected. Thanks for pointing my incorrect answer. :-) -- Igor C. Antonio Wolfram Research, Inc. http://www.wolfram.com To email me personally, remove the dash.