Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5325
| From | Don <donabc@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | DynamicModule Pure Function |
| Date | 2011-10-02 06:41 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j69130$rdu$1@smc.vnet.net> (permalink) |
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.
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
DynamicModule Pure Function Don <donabc@comcast.net> - 2011-10-02 06:41 +0000
csiph-web