MathGroup Archive 2008

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

Search the Archive

Re: Dynamic: feature?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88068] Re: Dynamic: feature?
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 23 Apr 2008 04:10:12 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <fukem6$s0m$1@smc.vnet.net>

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


  • Prev by Date: Re: Changing TextStyle within Show
  • Next by Date: Re: Timing
  • Previous by thread: Dynamic: feature?
  • Next by thread: RE: Re: Dynamic: feature? No, in my opinion is UpValues feature