<div dir="ltr">Hi Frank,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 12:58 PM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On 12 February 2014 19:05, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>

&gt; Hi Frank,<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Feb 12, 2014 at 1:35 AM, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com">frank.shearar@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On 12 February 2014 00:22, tim Rowledge &lt;<a href="mailto:tim@rowledge.org">tim@rowledge.org</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On 11-02-2014, at 5:02 PM, Jecel Assumpcao Jr. &lt;<a href="mailto:jecel@merlintec.com">jecel@merlintec.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Any discussion of what is Smalltalk and what isn&#39;t can&#39;t get very far<br>
&gt;&gt; &gt;&gt; without first clearly defining a few things.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In the same way that Filk is music performed by people that consider<br>
&gt;&gt; &gt; themselves to be Filkers, I would suggest that maybe Smalltalk is what is<br>
&gt;&gt; &gt; written by people that consider themselves to be Smalltalkers.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Is everything an object? Do objects have classes? Do objects communicate<br>
&gt;&gt; &gt; by sending messages and getting back results? Is an image saved and<br>
&gt;&gt; &gt; restarted? Can you forget about having to deal with memory allocation? If<br>
&gt;&gt; &gt; the answer is yes to those questions then it&rsquo;s probably a Smalltalk.<br>
&gt;&gt;<br>
&gt;&gt; Of course, this makes Common Lisp a Smalltalk :) (They certainly have<br>
&gt;&gt; a whole bunch of characteristics in common, which given Smalltalk&#39;s<br>
&gt;&gt; influences should not be a surprise.) (And no, I don&#39;t seriously<br>
&gt;&gt; consider Common Lisp a Smalltalk, just in case anyone thinks that I<br>
&gt;&gt; do.)<br>
&gt;<br>
&gt;<br>
&gt; Good that you don&#39;t think CL is a Smalltalk. &nbsp;But why? &nbsp;Generic functions vs<br>
&gt; message sends, instance encapsulation and syntax. &nbsp; I think generic<br>
&gt; functions are very different to Smalltalk/Self-style message sending<br>
&gt; (Java/C++/JavaScript message sending is much closer to Smalltalk).<br>
<br>
</div></div>Yes, as long as one also remembers that Foote, Johnson and Noble [1]<br>
showed that you can curry generic functions into single-dispatch<br>
message sends.<br>
<div class="im"><br>
&gt; &nbsp;And<br>
&gt; hence method combination is very different in CL to Smalltalk&#39;s simple super<br>
&gt; send.<br>
<br>
</div>Yes, this is a big difference. Mainly those are macro-like, IIRC. [3]<br>
It&#39;s been too long since I last touched Common Lisp!<br>
<div class="im"><br>
&gt; &nbsp;While Newspeak extends Smalltalk&#39;s send semantics with<br>
&gt; lexically-scoped sends, the extensions are still very much like Smalltalk<br>
&gt; message sends (polymorphic, dispatching on a single receiver). &nbsp;The other<br>
&gt; major difference is encapsulation. &nbsp;In CLOS there isn&#39;t any.<br>
<br>
</div>Kinda. I mean, sure, slot-value gives you direct access to a slot<br>
(what Smalltalk calls an instance variable, for those following<br>
along). But (slot-value foo &#39;bar) translates to foo instVarNamed:<br>
&#39;bar&#39;. Seeing slot-value in Common Lisp source ought to make you feel<br>
as queasy as when you see #instVarAt: and friends.<br>
<br>
I am half a world away from my copy of AMOP, so I can&#39;t find out<br>
whether the MOP lets you intercede slot-value calls. I&#39;m not sure of<br>
the differences between Common Lisp slots and Pharo&#39;s Slots, in other<br>
words.<br>
<div class="im"><br>
&gt; &nbsp;Generic<br>
&gt; functions imply that not everything is an object.<br>
<br>
</div>Surely generic functions are objects that have an apply method?<br>
Generic functions certainly do imply that functionality doesn&#39;t always<br>
belong only to one, privileged, class.<br></blockquote><div><br></div><div>No, I mean that generic functions can discriminate on anything, including singletons, s-exprs, right? &nbsp;So they&#39;re more general than message sending and allow one to access the Lisp types CLOS is built from.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">&gt; &nbsp;But CLOS has a MOP and<br>
&gt; we&#39;re in catch-up here. &nbsp;Pharo is doing good work with Slots. &nbsp;Finally<br>
&gt; syntax is important. &nbsp;The mixfix syntax that Smalltalk has is simple and<br>
&gt; powerful. &nbsp;CLOS has keyword arguments but they&#39;re quite different, for<br>
&gt; optional parameters and can have default values and occur in any order.<br>
<br>
</div>Yes, Common Lisp has a bit of a mess here. I mean, if you have keyword<br>
arguments, do you really need optionals as well? And then let both<br>
happen in the same function signature?!<br></blockquote><div><br></div><div>I&#39;m not sure I&#39;d call CLOS&#39;s approach messy. &nbsp;It /is/ very different. &nbsp;Smalltalk&#39;s designers put a lot of effort into designing a simple but powerful syntax (including for literals). &nbsp;And in doing that they avoided some of CLOS&#39;s flexibility.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">&gt; &nbsp;A<br>
&gt; final significant facility is multiple return values. &nbsp;Smalltalk has a neat<br>
&gt; hack (providing a block to receive the results), but that&#39;s not as<br>
&gt; convenient.<br>
<br>
</div>The hack - do you mean 1 in: [:x &nbsp;| x + 1] ?<br></blockquote><div><br></div><div>I mean this idiom:</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>self accessorsAndAssignmentsForMethod: method</div>
<div><span class="" style="white-space:pre">                </span>actuals: {}</div><div><span class="" style="white-space:pre">                </span>depth: 0</div><div><span class="" style="white-space:pre">                </span>interpreterClass: interpreterClass</div>
<div><span class="" style="white-space:pre">                </span>into: [:theRoots :theAccessors :theAssignments|</div><div><span class="" style="white-space:pre">                        </span>roots := theRoots.</div><div><span class="" style="white-space:pre">                        </span>accessors := theAccessors.</div>
<div><span class="" style="white-space:pre">                        </span>assignments := theAssignments].</div></div><div><br></div><div>It&#39;s nicer to be able to write</div><div><br></div><div><span style="white-space:pre">        </span>roots, accessors, assignments :=<br>
</div><div><div><span class="" style="white-space:pre">                </span>self accessorsAndAssignmentsForMethod: method</div><div><span class="" style="white-space:pre">        </span><span style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>actuals: {}</div>
<div><span class="" style="white-space:pre">        </span><span style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>depth: 0</div><div><span class="" style="white-space:pre">        </span><span style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>interpreterClass: interpreterClass</div>
</div><div><br></div><div>But as an implementor I&#39;m not sure the complexity pulls its weight. &nbsp;The closure hack works well enough.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Dan Ingalls, IIRC, had an extension or something where you could write<br>
&quot;a, b := self aMethodReturningaPair&quot;. Clojure&#39;s destructuring<br>
mechanisms [2] is probably the nicest thing I&#39;ve seen here. A pet hack<br>
I&#39;ve been working on has a #destructureIn: where you can say<br>
<br>
#(1 2) destructureIn: [:x :y | x + 1]<br>
<br>
which lets me avoid loads of local variables.<br></blockquote><div><br></div><div>Yes, I use something similar a fair bit</div><div><br></div><div>&nbsp; &nbsp; [:a :b ... | ... ] valueWithArguments: tuple</div><div><br></div><div>
etc.</div><div><br></div><div>And the Selector&gt;&gt;value[:...] hacks are clever too:</div><div><br></div><div>&nbsp; &nbsp; (2 to: n) select: #even</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
frank<br>
<br>
[1] <a href="http://www.laputan.org/reflection/Foote-Johnson-Noble-ECOOP-2005.html" target="_blank">http://www.laputan.org/reflection/Foote-Johnson-Noble-ECOOP-2005.html</a><br>
[2] <a href="http://blog.jayfields.com/2010/07/clojure-destructuring.html" target="_blank">http://blog.jayfields.com/2010/07/clojure-destructuring.html</a><br>
[3] <a href="http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html" target="_blank">http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html</a><br>
<span class=""><font color="#888888"><br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>