[Date Index] [Thread Index] [Author Index]
Re: Automatic update of variables
Are you kidding us? Using SetDelayed (:=) in the definition of b means the most current value of a are used anytime b is used. Check this: b := a a = 2; b a = 4; b yields 2, then 4. Or try b := a Dynamic[b] and the assign various values to a and see the dynamically displayed value of b changing immediately. By the way: b:=3 a +1 is not a delayed rule. That would be b:>3 a +1 Cheers -- Sjoerd On Jun 12, 11:31 am, Antonio De Ju=E1rez <adejua... at gmail.com> wrote: > Sometimes, I would find useful a method to update variables > automatically. For example, given the delayed rule > > b:=3 a+1; > > it would be useful to have b updated whenever a is assigned a new > value, like a=37. Is there any method to do this in Mathematica? > > Thanks, > > Antonio.