MathGroup Archive 2007

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

Search the Archive

Re: Monitor bug or feature

  • To: mathgroup at
  • Subject: [mg84107] Re: [mg84095] Monitor bug or feature
  • From: Carl Woll <carlw at>
  • Date: Mon, 10 Dec 2007 20:36:48 -0500 (EST)
  • References: <>

Mark Fisher wrote:

>Hi all,
>Monitor[Table[Pause[.1]; i, {i, 10}], i]
>works as I expected, but
>Table[Pause[.1]; i, {i, 10}] // Monitor[#, i] &
>does not: It does not produce any "monitoring".
>Are there other examples where
>f[x, a]
>produce different "effects". (Clearly the Heads of the expressions are
You are getting an evaluation leak. Monitor has the attribute HoldAll, 
and in the first example the Table expression is not evaluated until 
Monitor is ready. In the second example, the Table expression is 
evaluated too early. That is, the second example is really:

Monitor[{1,2,3,4,5,6,7,8,9,10}, i]

and of course, no monitoring will occur. In general,


will evaluate x before it is inserted into f. To avoid this, you can use 
Function with the optional third argument:

Table[Pause[.1]; i, {i, 10}] // Function[x, Monitor[x, i], HoldAll]

Carl Woll
Wolfram Research

>I'm guessing my surprise regarding this feature of Monitor reflects
>the fact that I really haven't made any attempt to understand Dynamic

  • Prev by Date: Re: Inset problems & Export
  • Next by Date: Re: Precedence of Infix Operator
  • Previous by thread: Monitor bug or feature
  • Next by thread: Re: Monitor bug or feature