Chris Osborn wrote:
> I have a cell containing this:
>
> Dynamic[f[a, b]]
>
> Then I do this:
>
> a /: f[a, b] = 12
>
> and the dynamic cell updates to 12, as I would expect.
>
> When I do this:
>
> b /: f[a, b] = 45
>
> The dynamic cell does *not* update for some reason.
> It seems as though it does not realize an update has occurred when it
> is associated with b.
>
> Does anyone know why this is?
>
> Thanks in advance,
> Chris
Weird. I witness the same behavior if the cells are evaluated in the
given order. However, ff one change the order of the assignments (i.e. b
first, then a) Dynamic[] works as expected. Evaluating the following
expressions in that order,
Dynamic[f[a, b]]
(* The first output cell is: f[a, b] *)
b /: f[a, b] = 45
(* The first output cell is now: 45 *)
a /: f[a, b] = 12
(* The first output cell is now: 12 *)
$Version => "6.0 for Mac OS X x86 (64-bit) (February 7, 2008)"
I have also recorded the sessions in a PDF file. See
http://homepages.nyu.edu/~jmg336/mathematica/weirddynamic.pdf
Regards,
-- Jean-Marc