Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Okay, several pieces here.</p> <p>First, I agree with markusQ, although I completely sympathize: I'd rather be able to write my code in EMACS directly. Bt one of the things about Smalltalk is that it really is very unforgiving of people who don't want to do things the Smalltalk Way. In this case, the Smalltalk Way is to use the browsers.</p> <p>Second, part of the reason that this is the Smalltalk Way is that Smalltalk is, in a lot of ways, not <em>like</em> other languages. There is really, for all practical purposes, no way to make a "separate" Smalltalk executable: all you can do is make an image of Smalltalk with some relatively small fragments of your own code added in. When you write code using an external editor, as with the syntax you show, you're literally just hand typing an import/export format that is somewhat easier to hand type than XML. But only somewhat.</p> <p>The moral is, do it the Smalltalk way, with the browsers.</p> <p>There are some fairly good tutorials for Smalltalk about. I usually use Squeak, so the ones I've seen are using Squeak, as <a href="http://wiki.squeak.org/squeak/792" rel="nofollow noreferrer">here</a>.</p> <p>On TDD, you're in luck because Smalltalk was the first place to get xUnit. For Smalltalk, it's called SUnit, and there's a good tutorial <a href="http://wiki.squeak.org/squeak/1547" rel="nofollow noreferrer">here</a>.</p> <p>You're using assertions there in what appears to be basically a "design by contract" approach. There has been work done on adding design by contract to Smalltalk, as <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.1768" rel="nofollow noreferrer">here</a>. For simple assertions, you can add code as in <a href="https://stackoverflow.com/questions/665455/smalltalk-and-assertions">this SO question</a>. </p> <pre><code>assert: aBlock "Throw an assertion error if aBlock does not evaluates to true." aBlock value ifFalse: [AssertionFailure signal: 'Assertion failed'] </code></pre>
 

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