<br><br><div class="gmail_quote">On Tue, Dec 22, 2009 at 1:12 PM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></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 <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>>:<br>
<div class="im">><br>
><br>
> On Tue, Dec 22, 2009 at 5:41 AM, Nicolas Cellier<br>
> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
>><br>
>> Why does this depend on interactive ?<br>
>><br>
>> method := self interactive ifTrue: [ methodNode<br>
>> generateWithTempNames ]<br>
>> ifFalse: [methodNode generate].<br>
>><br>
>> Nicolas<br>
>><br>
><br>
><br>
> The assumption is that one wants temp names preserved in doits, but is not<br>
> particularly interested in temp names in automatic compiles. Essentially<br>
> the system is in two modes. One, with source, does not preserve temp names<br>
> except for doits because the temp names are in the sources files. The<br>
> other, without sources, converts all methods to sourceless with encoded temp<br>
> names. But this isn't yet reflected in the code. The code would better<br>
> read something like<br>
> method := (self interactive or: [self noSourcesFiles])<br>
> ifTrue: [methodNode generateWithTempNames]<br>
> ifFalse: [methodNode generate]<br>
> and of course (self interactive or: [self noSourcesFiles]) could be<br>
> extracted into e.g. a class-side method on CompiledMethod or Compiler such<br>
> as<br>
> encodeTempNames: isInteractive<br>
> ^interactive or: [SourceFiles isNil]<br>
><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'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>>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>
" doing this"<br>
<br>
thisContext method getSource<br>
--------------<br>
<br>
prints:<br>
<br>
'DoIt<br>
" doing this"<br>
<br>
thisContext method getSource<br>
'<br>
<br>
if you find this useful, i could push change to trunk.<br></blockquote><div><br></div><div>I don'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>