Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5325 > unrolled thread

DynamicModule Pure Function

Started byDon <donabc@comcast.net>
First post2011-10-02 06:41 +0000
Last post2011-10-02 06:41 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  DynamicModule Pure Function Don <donabc@comcast.net> - 2011-10-02 06:41 +0000

#5325 — DynamicModule Pure Function

FromDon <donabc@comcast.net>
Date2011-10-02 06:41 +0000
SubjectDynamicModule Pure Function
Message-ID<j69130$rdu$1@smc.vnet.net>
In the Wolfram tutorial "Introduction to Dynamic" (tutorial/IntroductionToDynamic)
there is the following example approximately halfway into the tutorial:

DynamicModule[{x = 0}, {Slider[Dynamic[x]], 
  Slider[Dynamic[1 - x, (x = 1 - #) &]]}]


The explanation that Wolfram gives for why this works (i.e. the second Slider is the inverse function of the first Slider) is unintelligible to me.  Can anyone explain in plain, simple English (no jargon) what is going on here?

For example, when x = 0.25 the second slider has to be at position 0.75.  It can't update 1-x directly since 
1-x cannot be set to a value.  Of course, this
is true, but it doesn't explain why the pure function is the solution.


If x = 0.25, this implies that the # is equal to 0.75 since x = 1 - #.  But, how did the system know that # = 0.75?  Where did the 0.75 come from?


To put it another way, I am use to the # being a placeholder in pure functions that ranges over a
set of values.  For example, in Select[list, # > 0 &], the # ranges over all the elements of list.  What is # in the pure function of the second Dynamic ranging over and how does it come up with 0.75 as a value for #?

Thank you in advance for any clear explanations you can give me.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web