<br><br><div class="gmail_quote">On Tue, Dec 22, 2009 at 1:12 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2009/12/22 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div class="im">&gt;<br>
&gt;<br>
&gt; On Tue, Dec 22, 2009 at 5:41 AM, Nicolas Cellier<br>
&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Why does this depend on interactive ?<br>
&gt;&gt;<br>
&gt;&gt;       method := self interactive ifTrue: [    methodNode<br>
&gt;&gt; generateWithTempNames ]<br>
&gt;&gt;               ifFalse: [methodNode generate].<br>
&gt;&gt;<br>
&gt;&gt; Nicolas<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; The assumption is that one wants temp names preserved in doits, but is not<br>
&gt; particularly interested in temp names in automatic compiles.  Essentially<br>
&gt; the system is in two modes.  One, with source, does not preserve temp names<br>
&gt; except for doits because the temp names are in the sources files.  The<br>
&gt; other, without sources, converts all methods to sourceless with encoded temp<br>
&gt; names.  But this isn&#39;t yet reflected in the code.  The code would better<br>
&gt; read something like<br>
&gt;       method := (self interactive or: [self noSourcesFiles])<br>
&gt;                       ifTrue: [methodNode generateWithTempNames]<br>
&gt;                       ifFalse: [methodNode generate]<br>
&gt; and of course (self interactive or: [self noSourcesFiles]) could be<br>
&gt; extracted into e.g. a class-side method on CompiledMethod or Compiler such<br>
&gt; as<br>
&gt; encodeTempNames: isInteractive<br>
&gt;     ^interactive or: [SourceFiles isNil]<br>
&gt;<br>
<br>
</div>ideally, the decision what to do should be delegated to aRequestor, so<br>
code may be something like:<br>
<br>
method := methodNode generate: (aRequestor methodTrailerFor: methodNode)<br></blockquote><div><br></div><div>Except that aRequestor could be nil..  In fact I could also imagine that a sourceless system wouldn&#39;t necessarily want to encode temp names (for space and speed) in a sealed application.  So the choices are</div>
<div><br></div><div>if interactive always encode with sources</div><div>if not interactive</div><div>     if sources do not encode (temps in source)</div><div>     if not sources defer to a preference</div><div><br></div>
<div>And set the preference to true when doing abandonSources.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Meanwhile i made own version of Compiler&gt;&gt;evaluate: textOrStream in:<br>
<div class="im">aContext to: receiver notifying: aRequestor ifFail: failBlock logged:<br>
logFlag<br>
<br>
</div>which saving a full source code of doit in trailer, if its interactive.<br>
<br>
so evaluating given code:<br>
--------------<br>
&quot; doing this&quot;<br>
<br>
thisContext method getSource<br>
--------------<br>
<br>
prints:<br>
<br>
 &#39;DoIt<br>
&quot; doing this&quot;<br>
<br>
thisContext method getSource<br>
 &#39;<br>
<br>
if you find this useful, i could push change to trunk.<br></blockquote><div><br></div><div>I don&#39;t know.  Keeping temp names is adequate when doing doits for me.  If a doit gets big enough to need a comment it probably needs to be a proper method ;)  But what do others think?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>