<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 5:39 AM, 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 22:49, 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 12:58 PM, 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 19:05, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Hi Frank,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &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;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &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;&gt; &gt;<br>
&gt;&gt; &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;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Any discussion of what is Smalltalk and what isn&#39;t can&#39;t get very<br>
&gt;&gt; &gt;&gt; &gt;&gt; far<br>
&gt;&gt; &gt;&gt; &gt;&gt; without first clearly defining a few things.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; In the same way that Filk is music performed by people that consider<br>
&gt;&gt; &gt;&gt; &gt; themselves to be Filkers, I would suggest that maybe Smalltalk is<br>
&gt;&gt; &gt;&gt; &gt; what is<br>
&gt;&gt; &gt;&gt; &gt; written by people that consider themselves to be Smalltalkers.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Is everything an object? Do objects have classes? Do objects<br>
&gt;&gt; &gt;&gt; &gt; communicate<br>
&gt;&gt; &gt;&gt; &gt; by sending messages and getting back results? Is an image saved and<br>
&gt;&gt; &gt;&gt; &gt; restarted? Can you forget about having to deal with memory<br>
&gt;&gt; &gt;&gt; &gt; allocation? If<br>
&gt;&gt; &gt;&gt; &gt; the answer is yes to those questions then it&rsquo;s probably a Smalltalk.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Of course, this makes Common Lisp a Smalltalk :) (They certainly have<br>
&gt;&gt; &gt;&gt; a whole bunch of characteristics in common, which given Smalltalk&#39;s<br>
&gt;&gt; &gt;&gt; influences should not be a surprise.) (And no, I don&#39;t seriously<br>
&gt;&gt; &gt;&gt; consider Common Lisp a Smalltalk, just in case anyone thinks that I<br>
&gt;&gt; &gt;&gt; do.)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Good that you don&#39;t think CL is a Smalltalk. &nbsp;But why? &nbsp;Generic<br>
&gt;&gt; &gt; functions vs<br>
&gt;&gt; &gt; message sends, instance encapsulation and syntax. &nbsp; I think generic<br>
&gt;&gt; &gt; functions are very different to Smalltalk/Self-style message sending<br>
&gt;&gt; &gt; (Java/C++/JavaScript message sending is much closer to Smalltalk).<br>
&gt;&gt;<br>
&gt;&gt; Yes, as long as one also remembers that Foote, Johnson and Noble [1]<br>
&gt;&gt; showed that you can curry generic functions into single-dispatch<br>
&gt;&gt; message sends.<br>
&gt;&gt;<br>
&gt;&gt; &gt; &nbsp;And<br>
&gt;&gt; &gt; hence method combination is very different in CL to Smalltalk&#39;s simple<br>
&gt;&gt; &gt; super<br>
&gt;&gt; &gt; send.<br>
&gt;&gt;<br>
&gt;&gt; Yes, this is a big difference. Mainly those are macro-like, IIRC. [3]<br>
&gt;&gt; It&#39;s been too long since I last touched Common Lisp!<br>
&gt;&gt;<br>
&gt;&gt; &gt; &nbsp;While Newspeak extends Smalltalk&#39;s send semantics with<br>
&gt;&gt; &gt; lexically-scoped sends, the extensions are still very much like<br>
&gt;&gt; &gt; Smalltalk<br>
&gt;&gt; &gt; message sends (polymorphic, dispatching on a single receiver). &nbsp;The<br>
&gt;&gt; &gt; other<br>
&gt;&gt; &gt; major difference is encapsulation. &nbsp;In CLOS there isn&#39;t any.<br>
&gt;&gt;<br>
&gt;&gt; Kinda. I mean, sure, slot-value gives you direct access to a slot<br>
&gt;&gt; (what Smalltalk calls an instance variable, for those following<br>
&gt;&gt; along). But (slot-value foo &#39;bar) translates to foo instVarNamed:<br>
&gt;&gt; &#39;bar&#39;. Seeing slot-value in Common Lisp source ought to make you feel<br>
&gt;&gt; as queasy as when you see #instVarAt: and friends.<br>
&gt;&gt;<br>
&gt;&gt; I am half a world away from my copy of AMOP, so I can&#39;t find out<br>
&gt;&gt; whether the MOP lets you intercede slot-value calls. I&#39;m not sure of<br>
&gt;&gt; the differences between Common Lisp slots and Pharo&#39;s Slots, in other<br>
&gt;&gt; words.<br>
&gt;&gt;<br>
&gt;&gt; &gt; &nbsp;Generic<br>
&gt;&gt; &gt; functions imply that not everything is an object.<br>
&gt;&gt;<br>
&gt;&gt; Surely generic functions are objects that have an apply method?<br>
&gt;&gt; Generic functions certainly do imply that functionality doesn&#39;t always<br>
&gt;&gt; belong only to one, privileged, class.<br>
&gt;<br>
&gt;<br>
&gt; No, I mean that generic functions can discriminate on anything, including<br>
&gt; singletons, s-exprs, right? &nbsp;So they&#39;re more general than message sending<br>
&gt; and allow one to access the Lisp types CLOS is built from.<br>
<br>
</div></div>They can, yes. But singletons and sexprs are still just objects. So<br>
for instance, discriminating on a particular object is still just a<br>
message send (well, in my head it is), albeit the definition of the<br>
method isn&#39;t attached to a class.<br></blockquote><div><br></div><div>Yeah. &nbsp;I guess I have this bias that whatever existed before CLOS wasn&#39;t an object but that&#39;s mistaken. &nbsp;generic functions allows CLOS to assimilate the existing types as objects. &nbsp;The borg within :-). &nbsp;Compare this with e.g. Objective-C,Java/C++ where the C and/or primitive types are not objects. &nbsp;Good for CLOS.&nbsp;</div>
<div>&nbsp;</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"><br>
&gt;&gt; &gt; &nbsp;But CLOS has a MOP and<br>
&gt;&gt; &gt; we&#39;re in catch-up here. &nbsp;Pharo is doing good work with Slots. &nbsp;Finally<br>
&gt;&gt; &gt; syntax is important. &nbsp;The mixfix syntax that Smalltalk has is simple and<br>
&gt;&gt; &gt; powerful. &nbsp;CLOS has keyword arguments but they&#39;re quite different, for<br>
&gt;&gt; &gt; optional parameters and can have default values and occur in any order.<br>
&gt;&gt;<br>
&gt;&gt; Yes, Common Lisp has a bit of a mess here. I mean, if you have keyword<br>
&gt;&gt; arguments, do you really need optionals as well? And then let both<br>
&gt;&gt; happen in the same function signature?!<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m not sure I&#39;d call CLOS&#39;s approach messy. &nbsp;It /is/ very different.<br>
&gt; Smalltalk&#39;s designers put a lot of effort into designing a simple but<br>
&gt; powerful syntax (including for literals). &nbsp;And in doing that they avoided<br>
&gt; some of CLOS&#39;s flexibility.<br>
<br>
</div>I didn&#39;t say CLOS&#39;s approach messy.</blockquote><div><br></div><div>&quot;<span style="color:rgb(80,0,80)">Yes, Common Lisp has a bit of a mess here.&quot; ;-)</span></div><div>&nbsp;</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">
 I find it odd that Common Lisp<br>
allows both keyword args and optional args, when keyword args are<br>
inherently optional (in Common Lisp, that is). Plus you don&#39;t have to<br>
argument-count if you just have keywords (in addition to the normal<br>
parameters).<br>
<br>
I think that the before/after/around method combinations to be very neat.<br></blockquote><div><br></div><div>They&#39;re very powerful. &nbsp;But personally I find the Smalltalk approach more than adequate. &nbsp;super allows one to do most things CLOS method combination is used for and is easier to understand. &nbsp;I think that&#39;s the important philosophical difference. &nbsp;There&#39;s a minimality about Smalltalk that I love.</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"><br>
&gt;&gt; &gt; &nbsp;A<br>
&gt;&gt; &gt; final significant facility is multiple return values. &nbsp;Smalltalk has a<br>
&gt;&gt; &gt; neat<br>
&gt;&gt; &gt; hack (providing a block to receive the results), but that&#39;s not as<br>
&gt;&gt; &gt; convenient.<br>
&gt;&gt;<br>
&gt;&gt; The hack - do you mean 1 in: [:x &nbsp;| x + 1] ?<br>
&gt;<br>
&gt;<br>
&gt; I mean this idiom:<br>
&gt;<br>
&gt; self accessorsAndAssignmentsForMethod: method<br>
&gt; actuals: {}<br>
&gt; depth: 0<br>
&gt; interpreterClass: interpreterClass<br>
&gt; into: [:theRoots :theAccessors :theAssignments|<br>
&gt; roots := theRoots.<br>
&gt; accessors := theAccessors.<br>
&gt; assignments := theAssignments].<br>
&gt;<br>
&gt; It&#39;s nicer to be able to write<br>
&gt;<br>
&gt; roots, accessors, assignments :=<br>
&gt; self accessorsAndAssignmentsForMethod: method<br>
&gt; actuals: {}<br>
&gt; depth: 0<br>
&gt; interpreterClass: interpreterClass<br>
&gt;<br>
&gt; But as an implementor I&#39;m not sure the complexity pulls its weight. &nbsp;The<br>
&gt; closure hack works well enough.<br>
<br>
</div>Yes, this is the hack I meant. And I agree re the closure hack: it<br>
looks a lot like a let binding, too. (It was #into: I was thinking of,<br>
not #in:, obviously) I suppose the only thing I don&#39;t particularly<br>
like is that the value comes before the variable, so instead of<br>
<br>
(let [f 1]<br>
&nbsp; &nbsp;;Clojure stuff)<br>
<br>
it&#39;s<br>
<br>
1 into: [:f |<br>
&nbsp; &nbsp; &quot;Smalltalk stuff&quot;].<br></blockquote><div><br></div><div>Yes, again I accept it because of its minimality.&nbsp;</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;&gt; Dan Ingalls, IIRC, had an extension or something where you could write<br>
&gt;&gt; &quot;a, b := self aMethodReturningaPair&quot;. Clojure&#39;s destructuring<br>
&gt;&gt; mechanisms [2] is probably the nicest thing I&#39;ve seen here. A pet hack<br>
&gt;&gt; I&#39;ve been working on has a #destructureIn: where you can say<br>
&gt;&gt;<br>
&gt;&gt; #(1 2) destructureIn: [:x :y | x + 1]<br>
&gt;&gt;<br>
&gt;&gt; which lets me avoid loads of local variables.<br>
&gt;<br>
&gt;<br>
&gt; Yes, I use something similar a fair bit<br>
&gt;<br>
&gt; &nbsp; &nbsp; [:a :b ... | ... ] valueWithArguments: tuple<br>
&gt;<br>
&gt; etc.<br>
&gt;<br>
&gt; And the Selector&gt;&gt;value[:...] hacks are clever too:<br>
&gt;<br>
&gt; &nbsp; &nbsp; (2 to: n) select: #even<br>
<br>
</div>Don&#39;t say that to Gilad :) &quot;Inherently reflective&quot; (and therefore<br>
problematic from a stratification point of view) was how he described<br>
them last time I said that I liked them. I think I did at one point<br>
understand why he said that... and I should have written it down.<br>
<a href="https://groups.google.com/forum/#!topic/newspeaklanguage/m2PO5RSQwFk" target="_blank">https://groups.google.com/forum/#!topic/newspeaklanguage/m2PO5RSQwFk</a><br>
has the conversation.<br></blockquote><div><br></div><div>I do say such things to Gilad. &nbsp;He and I disagree on plenty of things ;-). &nbsp;That we can&nbsp;disagree still work together is a pleasure. &nbsp;There&#39;s much creative discussion to be had in exploring differences.</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"><span class=""><font color="#888888">frank<br>

</font></span><div class=""><div class="h5"><br>
&gt;&gt; frank<br>
&gt;&gt;<br>
&gt;&gt; [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>
&gt;&gt; [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>
&gt;&gt; [3]<br>
&gt;&gt; <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></div></div></blockquote></div>
-- <br>best,<div>Eliot</div>
</div></div>