<div dir="ltr">I mean, the decompiler knows that it's a literal...<br><div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-03 22:41 GMT+02:00 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Something strikes me: if it's a literal, then we should print it as literal rather than asking whether we should or could...<div><div class="h5"><br><div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-03 22:34 GMT+02:00 Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>    I'm cleaning up the decompiler and the changes back in 2015 for deciding which characters are literal or not affects e.g. Date>>printOn: ::</div><div><br></div><div><div>printOn: aStream</div><div><br></div><div><span class="m_2949279478778306272m_1776177965533725852gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>self printOn: aStream format: #(1 2 3 $  3 1 )</div><div><br></div><div><br></div><div>This currently decompiles as</div><div><br></div><div><div>printOn: aStream </div><div><span class="m_2949279478778306272m_1776177965533725852gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>self printOn: aStream format: ((Array new: 6) at: 1 put: 1; at: 2 put: 2; at: 3 put: 3; at: 4 put: Character space; at: 5 put: 3; at: 6 put: 1; yourself)</div></div><div><br></div><div>I see four approaches</div><div><br></div><div>1. live with it</div><div><br></div><div>2. add an exception to LiteralNode>>printOn:indent: that invokes a special case Array print routine that forces printing as a Literal (this also requires special case printing in Character; I suggest we refactor all literal printing as printAsLiteralOn: if we take this approach)</div><div><br></div><div>3. relent and allow space (but no other whitespace character) to be considered as a literal</div><div><br></div><div>4. make an exception for Character space only when being printed in an Array:</div><div><br></div><div><div>shouldBePrintedAsLiteralVisiti<wbr>ng: aSet</div><div><br></div><div><span class="m_2949279478778306272m_1776177965533725852gmail-Apple-tab-span" style="white-space:pre-wrap">     </span>^self shouldBePrintedAsLiteral or: [self == Character space]</div></div><div><br></div><div>2. is I think the nicer.  It would allow LiteralNode to insist that a literal print itself as literal and hence would correctly decompile e.g. the legal (but rightly disapproved of)</div><div><div>shouldBePrintedAsLiteralVisiti<wbr>ng: aSet</div><div><br></div><div><span class="m_2949279478778306272m_1776177965533725852gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>^self shouldBePrintedAsLiteral or: [self == $ ]</div></div><div><br></div><div>Thoughts, opinions?</div><div class="m_2949279478778306272m_1776177965533725852gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>
<br><br>
<br></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div></div>