<br><br><div class="gmail_quote">On Tue, Nov 3, 2009 at 1:51 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/11/3 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 Tue, Nov 3, 2009 at 1:06 PM, 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; 2009/11/3 Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;:<br>
&gt;&gt; &gt; Nicolas Cellier wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; While at isSelfEvaluating, I wonder why we do not abuse {..} notation<br>
&gt;&gt; &gt;&gt; a bit more.<br>
&gt;&gt; &gt;&gt; Instead of printing &#39;aSet( 0@0 1@2 )&#39;<br>
&gt;&gt; &gt;&gt; we could just make it evaluate proof &#39;{0@0. 1@2} asSet&#39;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Of course, with limited stream, we take the risk of loosing trailing &#39;<br>
&gt;&gt; &gt;&gt; asSet&#39; information.<br>
&gt;&gt; &gt;&gt; So we can also print using a less nice but still evaluating &#39;Set<br>
&gt;&gt; &gt;&gt; newFrom: {0@0. 1@2}&#39;.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; As a bonus, generalizing this behaviour might also eliminate a few<br>
&gt;&gt; &gt;&gt; bytecodes and methods from the Kernel.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Same for storeOn:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; What do you think ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; -1. The goal of printing isn&#39;t to make parsing easier. In fact I find<br>
&gt;&gt; &gt; this<br>
&gt;&gt; &gt; to be the least useful application of {} - the advantage of the syntax<br>
&gt;&gt; &gt; form<br>
&gt;&gt; &gt; is that it is immediately recognized and consequently requires less<br>
&gt;&gt; &gt; effort<br>
&gt;&gt; &gt; than having &quot;an Array(&quot;. That you can also evaluate it in some<br>
&gt;&gt; &gt; situations is<br>
&gt;&gt; &gt; a useful side effect but no more.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Cheers,<br>
&gt;&gt; &gt;  - Andreas<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; OK, I see &#39; newFrom: &#39; can be considered as noise, so we can&#39;t have<br>
&gt;&gt; our cake and eat it too ?<br>
&gt;&gt; I find the fact that simple objects print as a simple code snippet<br>
&gt;&gt; such a nice feature though...<br>
&gt;&gt; Set &lt;&lt; {0@0. 1@2} would be short, but I guess introducing a new binary<br>
&gt;&gt; selector will be hard to sell :)<br>
&gt;<br>
&gt; yuck.  asSet is readable and in the Smalltalk tradition.  &lt;&lt; sMLells ;)<br>
<br>
</div></div>Like <a href="http://en.wikipedia.org/wiki/ML_%28programming_language%29" target="_blank">http://en.wikipedia.org/wiki/ML_%28programming_language%29</a> ?<br></blockquote><div><br></div><div>ML.  I remember seeing an ML program at Queen Mary that had about 25 user-defined operators in its precedence table.  One has to be a sadist or a monk to define one&#39;s own operators with one&#39;s own precedence.  A sadist if one expects anyone else to read the program, and a monk otherwise :)</div>
<div><br></div><div>I can sort of live with &lt;&lt; and &gt;&gt; for shift because they&#39;re used in more than just C, but overloading it for collection creation is IMO a step too far :)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Oh, didn&#39;t know about this one<br>
<a href="http://en.wikipedia.org/wiki/Miranda_%28programming_language%29" target="_blank">http://en.wikipedia.org/wiki/Miranda_%28programming_language%29</a><br>
<br>
Using asSet is taking the risk of loosing class information because of<br>
<br>
printStringLimitedTo: limit<br>
        &quot;Answer a String whose characters are a description of the receiver.<br>
        If you want to print without a character limit, use fullPrintString.&quot;<br>
        | limitedString |<br>
        limitedString := String streamContents: [:s | self printOn: s]<br>
limitedTo: limit.<br>
        limitedString size &lt; limit ifTrue: [^ limitedString].<br>
        ^ limitedString , &#39;...etc...&#39;<br>
<br>
<br>
&gt;&gt;<br>
&gt;&gt; Nicolas<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br>