Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not a creator of a smalltalk, but it seems to be the best thing to do.</p> <p>For example if you'll execute:</p> <pre><code>var := myInstance myMethod. </code></pre> <p>then the question is: what do you want <code>var</code> to become? One option will be <code>nil</code>. But it's a bit confusing, because you are working with defined objects and <code>nil</code> is actually an undefined one. So you can treat it as you are assigning <code>myInstance</code> to <code>var</code> and just calling myMethod along the way. Also this can be probably treated as a shorthand for </p> <pre><code> var := myInstance myMethod; yourself. </code></pre> <p>If you'll look from the inside, then from all data available to the object itself the most appropriate thing is probably also <code>self</code>. Once again, the <code>nil</code> can be returned, but I've told my opinion on it before.</p> <p>In Smalltalk there is no such thing as a <em>void</em> method that returns nothing, and there is no type checking. So a method just has to return something. It's like the Object says: </p> <blockquote> <p>I can return myself for any method call by default because I always know about myself, and you can redefine this behavior in case you want me to return something else.</p> </blockquote> <p>Personally I think that returning <code>nil</code> might be good too, and <em>Objective-C</em> applications use <code>nil</code> stuff very often, but Smalltalk is made this way and I think it's a quite good solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload