Manipulate doesn't always evaluate in the order I expect it to. What is the evaluation sequence for Manipulate and other functions involved with the front end? I have seen the evaluation sequence for kernel only functions, but that was for a reference for Mathematica 3, and doesn't deal with the front end.

  • 1
    $\begingroup$ Can you provide an example of Manipulate not evaluating in a certain sequence? $\endgroup$ Jan 18, 2012 at 5:50
  • $\begingroup$ Using the initialization option, it will evaluate the variables for the controls, then the initialization and then the content. The question is more focused on what is the actual evaluation sequence though. $\endgroup$
    – insect
    Jan 18, 2012 at 5:55
  • $\begingroup$ Well you seem to have answered your own question then. $\endgroup$ Jan 18, 2012 at 5:56
  • $\begingroup$ Not quite what I was hoping for. I'll see if I can find the one for the kernel tomorrow to better explain. $\endgroup$
    – insect
    Jan 18, 2012 at 6:04
  • 1
    $\begingroup$ This SO post (especially the answers) might be useful here: Print Dynamic variable inside DynamicModule $\endgroup$ Jan 18, 2012 at 12:16

1 Answer 1


According to my previous experiences and this post, the sequence goes like this (please feel free to correct me in this post):

  1. From the documentation:

    Manipulate generates a DynamicModule object, with the variables u, v, etc. specified as local.

    That is, first Manipulate wraps its result into DynamicModule, then...

  2. ...gives unique names to local variables (as it is a scoping construct).
  3. Next, the body of Manipulate is evaluated in standard order.
  4. The output cell is created by evaluating the result of the DynamicModule (or the Manipulate).
  5. If there was any Initialization :> init inside Manipulate, it is now evaluated "when the result is first displayed in a particular session".
  6. If there is any Deinitialization :> deinit inside Manipulate and the dynamic output cannot be displayed any more, deinit is evaluated.

Contraintuitively, Initialization is called almost ultimately which caused me some frustration over time.

To understand how to load a package with your dynamic content by Needs, see my answer here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.