<br><br><div class="gmail_quote">On Fri, Oct 30, 2009 at 1:45 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@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/10/30 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt; On Fri, Oct 30, 2009 at 12:55 PM, Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Question: I&#39;ve always wondered what this &quot;isSelfEvaluating&quot; stuff is good<br>
&gt;&gt; for. There are thirteen implementors and a single user in Array&gt;&gt;printOn:.<br>
&gt;&gt; Is there any *need* for Array&gt;&gt;printOn: to print a &quot;self evaluating&quot;<br>
&gt;&gt; expression? Why not just Array(element1, element2, ....) just like any other<br>
&gt;&gt; collection?<br>
&gt;&gt;<br>
&gt;&gt; We&#39;d remove some 20 methods with no downside that I am aware of.<br>
&gt;<br>
&gt; Shouldn&#39;t the test be isLiteral instead of isSelfEvaluating? c.f. storeOn:<br>
&gt; storeOnStream:.<br>
&gt;<br>
<br>
</div></div>Yes that&#39;s the default behaviour of Object&gt;&gt;isSelfEvaluating.<br>
But the 3.9 team wanted to extend this to a few other objects, like<br>
Point, Rectangle, ...<br>
The reason for this extension is the presence of brace notation.<br></blockquote><div><br></div><div>Right.  So with braces one either prints arrays as literals or as braces.  Whether an element of an array prints as self-evaluating is up to it right?  e.g. I would prefer it if</div>
<div><br></div><div>    Array with: OrderedCollection new</div><div> </div><div>prints as { OrderedCollection () } than #(OrderedCollection ()).  The first is a syntax error but the second is completely ambiguous (i.e. evaluates to  #(#OrderedCollection #())).</div>
<div><br></div><div>So I don&#39;t see the need to provide isSelfEvaluating.  isLiteral gives you all that you need to avoid printing an Array as a literal when it isn&#39;t.  And if you&#39;ve drunk the braces kool aid (which I have, while studying my agrippa) you&#39;re happy with Arrays printing themselves as brace constructs naively even when the naive print produces non-code.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Nicolas<br>
<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt;  - Andreas<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br>