<br><br><div class="gmail_quote">On Tue, Jun 30, 2009 at 10:33 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@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/6/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 Mon, Jun 29, 2009 at 8:59 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2009/6/30 Cameron Sanders &lt;<a href="mailto:csanders.personal@functional-analyst.com">csanders.personal@functional-analyst.com</a>&gt;:<br>
&gt;&gt; &gt; What you write (down below) is close to what I was thinking when I said<br>
&gt;&gt; &gt; have<br>
&gt;&gt; &gt; all #isXXX return false by default;<br>
&gt;&gt; &gt; although I would test that the first two characters match &#39;i&#39; and &#39;s&#39;<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; that more characters exist, if so, return false, otherwise, normal<br>
&gt;&gt; &gt; #doesNotUnderstand: behavior.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I would treat #is by itself differently... it is ... or it couldn&#39;t be<br>
&gt;&gt; &gt; tested! So I would do nothing for simple #is. and I don&#39;t like #is:<br>
&gt;&gt; &gt; because<br>
&gt;&gt; &gt; it looks like a class type test... but that is part of the point, eh?<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; I wouldn&#39;t say that. It is more trait-based approach than class-based.<br>
&gt;&gt;<br>
&gt;&gt; The concept of #is: are: When object foo having some trait, it should<br>
&gt;&gt; answer true on &#39;foo is: sometrait &#39;, otherwise false.<br>
&gt;&gt; Obviously since most subclasses inherit the behavior &amp; traits of base<br>
&gt;&gt; class, you should honor this rule in overrides of #is: method<br>
&gt;&gt; i.e.:<br>
&gt;&gt;<br>
&gt;&gt; Someclass&gt;&gt;is: object<br>
&gt;&gt;  ^ (your tests here) or: [ super is: object ]<br>
&gt;&gt;<br>
&gt;&gt; otherwise, if you omit the super send, some of the traits will become<br>
&gt;&gt; unavailable. But of course, except when you doing this intentionally.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; I&#39;ll have to go back to the original example (by <a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>, and<br>
&gt;&gt; &gt; read more about lambdas) but I thought that CVLambda would implement<br>
&gt;&gt; &gt; #isCVLambda  to return true when it can be verified to be one. The<br>
&gt;&gt; &gt; example<br>
&gt;&gt; &gt; did not illustrate #doesNotUnderstand:.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Back to the question of adding behavior to classes that you don&#39;t own.<br>
&gt;&gt; &gt; VisualWorks has a means to extend a class in a different package ... as<br>
&gt;&gt; &gt; I<br>
&gt;&gt; &gt; recall. As I recall, squeak has no such capability, right?<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; MC having this capability for a years.<br>
&gt;<br>
&gt; Arguably<br>
&gt; not.  (BTW VW has had it from 98).  The crucial difference is that in<br>
&gt; VW an extension can be in more than one package.  In Squeak a selector can<br>
&gt; only be in a single Monticello extension category.  That leads to the awful<br>
&gt; bug that when an MC package patches a base selector to extend it to fix a<br>
&gt; bug it ends up in the package and its membership of the package it was in<br>
&gt; previously being lost.  I understand that with method history this situation<br>
&gt; can be detected but if you e.g. condense changes then that history is lost,<br>
&gt; and the base package selector becomes only an extension  Ouch.<br>
&gt; The VW &quot;solution&quot; is OK as far as it goes; a package is a set of class,<br>
&gt; selector pairs (more than this, but this is the essence).  An MC package is<br>
&gt; defined by class and method categories.  VW&#39;s parcels are intensional, MC<br>
&gt; packages are extensional.  There&#39;s a tension in both; many VW&#39;ers want, at<br>
&gt; least at the UI level, for packages to be extensional, but precision<br>
&gt; (knowing whether something is in a package or not, allowing things to be in<br>
&gt; more than one package so that one can include patches, etc) requires an<br>
&gt; intentional construct.<br>
&gt; When you also provide selector namespaces I don&#39;t think the situation<br>
&gt; changes because one still needs patches in the absence of a perfectly<br>
&gt; designed system.  So IMO somehow MC needs to move to an intensional package<br>
&gt; definition, at least for extensions ;)<br>
&gt;<br>
<br>
</div></div>i just wanted to point that MC having an extension mechanism. Yes, it<br>
is different from VW one.<br>
And in the light of your description - it is done wrong (at least for<br>
me), but its still can be called &#39;extension mechanism&#39; :)</blockquote><div><br></div><div>then +1 :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<div class="im"><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; Thanks. You have given me food for thought...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Ciao,<br>
&gt;&gt; &gt; Cam<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Jun 29, 2009, at 3:43 PM, David Goehrig wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; What I typically what I&#39;ve been doing to eliminate all of these methods<br>
&gt;&gt; &gt;&gt; with a single simple change:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Object<br>
&gt;&gt; &gt;&gt;   doesNoUnderstand: aMessage<br>
&gt;&gt; &gt;&gt;       ^ false<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div>--<br>
<div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>