<br><br><div class="gmail_quote">On Tue, Jan 13, 2009 at 2:15 AM, Martin Beck <span dir="ltr">&lt;<a href="mailto:martin.beck@hpi.uni-potsdam.de">martin.beck@hpi.uni-potsdam.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="Wj3C7c">Igor Stasenko wrote:<br>
&gt; 2009/1/12 nicolas cellier &lt;<a href="mailto:ncellier@ifrance.com">ncellier@ifrance.com</a>&gt;:<br>
&gt;&gt; Following cascading of macros, I need turning some inline off. A recurrent<br>
&gt;&gt; topic in Squeak-dev.<br>
&gt;&gt;<br>
&gt;&gt; Well, once i thought about using a Compiler reflective annotation (i.e. a<br>
&gt;&gt; pragma) in order to turn optimization off.<br>
&gt;&gt;<br>
&gt;&gt; Stupid me.<br>
&gt;&gt; Inlined messages are made of block receiver/arguments.<br>
&gt;&gt; So one would simply turn inlining off by sending a yourself message to a<br>
&gt;&gt; block.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;[false] yourself whileTrue.<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;false ifTrue: [self inspect] yourself.<br>
&gt;&gt;<br>
&gt;&gt; Of course, yourself is not a very explicit message...<br>
&gt;&gt; We could create another #turnOffInlining or something...<br>
&gt;&gt;<br>
&gt;&gt; Except that in Squeak as other Smalltalks, the Old Compiler is quite<br>
&gt;&gt; pedantic about optimizing these messages.<br>
&gt;&gt;<br>
&gt;&gt; [false] yourself &nbsp;&lt;- receiver of whileTrue must be a block or variable<br>
&gt;&gt; -&gt;whileTrue.<br>
&gt;&gt;<br>
&gt;&gt; false ifTrue: [self inspect] &nbsp;&lt;- argument of ifTrue: must be a block or<br>
&gt;&gt; variable -&gt;yourself.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Common! You don&#39;t like the system? Change It!<br>
&gt;&gt; This is just 1 method attached.<br>
&gt;<br>
&gt; Heh.. you seem stumbled upon same things as i was :)<br>
&gt;<br>
&gt; well, if you writing own code so you have a total control whether you<br>
&gt; want inlining or not, you can simply write:<br>
&gt; [ ... ] perform: #whileTrue<br>
&gt;<br>
</div></div>But keep in mind, that (at least in my Squeak 3.10 image)<br>
BlockContext&gt;&gt;whileTrue: is defined recursively:<br>
<br>
whileTrue: aBlock<br>
 &nbsp;^ [self value] whileTrue: [aBlock value]</blockquote><div><br></div><div>Argh! &nbsp;Never try to write an email when you&#39;re hurrying before taking the kids to school. &nbsp;This one works:</div><div><br></div><div>whileTrue: aBlock</div>
<div>&nbsp;&nbsp; &nbsp;^self value ifTrue:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[aBlock value.</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; self whileTrue: aBlock]</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Thus, you still get inlined code somewhere. However, this can be changed<br>
to use BlockContext&gt;&gt;restart, I think...<br>
<br>
Regards, Martin<br>
<br>
</blockquote></div><br>