<br><div class="gmail_quote">2011/4/1 Yoshiki Ohshima <span dir="ltr">&lt;<a href="mailto:yoshiki@vpri.org">yoshiki@vpri.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

  I don&#39;t understand the problem.  Let us say we start from the<br>
example in the method:<br>
<br>
--------------------<br>
<div class="im">&#39;Now here&#39;&#39;s some Real Progress&#39;<br>
        displayProgressAt: Sensor cursorPoint<br>
        from: 0 to: 10<br>
        during: [:bar |<br>
        1 to: 10 do: [:x | bar value: x.<br>
                        (Delay forMilliseconds: 500) wait]].<br>
</div>--------------------<br>
<br>
and your &quot;algorithm&quot; here would be:<br>
<br>
        1 to: 10 do: [:x | &quot;do something here&quot;<br>
                        (Delay forMilliseconds: 500) wait].<br>
<br>
It is already reasonably decoupled to me, but I take that you want to<br>
keep the &quot;algorithm&quot; really prestine and don&#39;t want to have &quot;bar<br>
value: x&quot; call in there, and completely get rid of anything from &quot;do<br>
something here&quot;.  Is this the case?<br>
<br>
  There still have to have some way to tell how much percent of work<br>
done from the &quot;algorithm&quot; to the progress notification mechanism.  In<br>
the possible meta approach (which would not be that hard at all), I&#39;d<br>
make an instance variable for the object that represents your<br>
algorithm state, and the algorithm assigns a value to the instance<br>
variable, and the progress bar displayer that is running in a separate<br>
thread looks at the variable periodically and update the screen.<br></blockquote><div><br>You dont really need to convert some temp to instance variables. You can track some current context temp variable value (context of concrete process which executes algorithm).<br>

So you need meta description to specify what peace of code in process context provide progress information<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

 
 Note that your algorithm may not be a loop.  It is totally legitimate<br>
to write:<br>
<br>
algorithm<br>
        self doA.<br>
        bar value: 0.33.<br>
        self doB.<br>
        bar value: 0.66.<br>
        self doC.<br>
<br>
where doA, doB, doC are long running computation.  So, really generic<br>
way to view the progress of something from outside without the<br>
knowledge of where to look at and how to interpret these values are<br>
not going to fly.<br></blockquote></div><br>It&#39;s not problem. We have algorithm:<br><br>MyClass&gt;&gt;algorithm<br>
        self doA.<br>
        self doB.<br>
        self doC.<br><br>And with meta description we can write like:<br><br>Progress for: MyClass&gt;&gt;algorithm when: [:desc |<br>    desc for: MyClass&gt;&gt;doB value: 0.33.<br>   desc for: MyClass&gt;&gt;doC value: 0.66<br>

]<br><br>And doA/B/C can doing some inner loops which we can track with extra meta descriptions.<br><br><br>