Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


A set of tests to teach you Smalltalk

Subscribe to updates I use gnu_smalltalk_koans

Statistics on gnu_smalltalk_koans

Number of watchers on Github 144
Number of open issues 0
Average time to close an issue 2 days
Main language Smalltalk
Average time to merge a PR 7 days
Open pull requests 0+
Closed pull requests 1+
Last commit over 3 years ago
Repo Created almost 10 years ago
Repo Last Updated over 2 years ago
Size 118 KB
Homepage https://skim.la/g...
Organization / Authorsl4m
Page Updated
Do you use gnu_smalltalk_koans? Leave a review!
View gnu_smalltalk_koans activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating gnu_smalltalk_koans for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

GNU Smalltalk Koans

Hey there and welcome!

Supported GNU Smalltalk Versions

GNU Smalltalk versions 3.2.2 or higher should work on Mac OS X and Linux. I have written these koans on 3.2.2, Mac OS X 10.6.

Note: I am certain that 3.0.x does not work and it will complain about not understanding #asString.

Installing GNU Smalltalk on Mac OS X

The simplest way to install GNU Smalltalk is via homebrew:

brew install gnu-smalltalk

This will build GNU Smalltalk 3.2.5. If you want the latest, I encourage you to try HEAD:

brew install gnu-smalltalk --HEAD

Installing GNU Smalltalk on Linux

Make sure you have the following tools installed:

  • Autoconf 2.65 or later
  • Automake 1.11 or later
  • Libtool 2.2 or later
  • Bison 2.0 or later
  • Flex 2.5.x

Grab GNU Smalltalk 3.2.5 source from ftp://ftp.gnu.org/gnu/smalltalk.

autoreconf -vi
sudo make install

Test by running gst and interact with the REPL.

Running koans

In the root directory of the project, type:


You will see a message similar to this:

TestAssert#testTruth has damaged your karma.

This means you will need to open the TestAssert.st file under src/koans and solve the test under testTruth method (aka message).

All koan files contain a set of tests, each starting with 'test'. Solve each test one by one, running script/run in between.

By default, script/run does not reveal the answer. If you are truly stuck in a koan, type script/run_and_reveal to run and reveal the answer. Use this sparingly!

Editors with Smalltalk support

  • vim
  • emacs

Things You Should Know Before Starting

| variable1 variable2 | is to declare variable1 and variable2 separate by a space. At least one space must be used to separate variables. Commas are not used.

:= is an assignment operator

"this is a comment"

'this is a string'

#speak is the notation used to describe the message 'speak'.

Words wrapped in <> are called pragmas and define class comments, category, imported namespaces, and the shape of indexed instance variables. More information here.

In depth information here.

Ok, have at it!

List of Koans

  • TestAssert
  • TestBasic
  • TestNil
  • TestObject
  • TestMessage
  • TestNumber
  • TestString
  • TestCharacter
  • TestSymbol
  • TestArray
  • TestOrderedCollection
  • TestSortedCollection
  • TestBag
  • TestAssociation
  • TestDictionary
  • TestSet
  • TestBlock
  • TestCollectionsRevisited
  • TestIteration
  • TestBoolean
  • TestException
  • TestRegex
  • TestClass

Future Koans

  • TestMetaclass

Pull Requests and Feedback are Welcome!

Please create a GitHub issue or find me on Twitter (@skim), if you have any suggestions on how to improve existing koans, new koans, or any other comments.

Inspiration and Credits

GNU Smalltalk Koans were inspired by Ruby Koans and Clojure Koans.

Thanks to Matt Yoho at Edgecase for letting me port some of the koans over.


Other thanks:



GNU Smalltalk Koans shares the same license as Ruby Koans and is released under a Creative Commons, Attribution-NonCommercial-ShareAlike, Version 3.0 (https://creativecommons.org/licenses/by-nc-sa/3.0/) License.

gnu_smalltalk_koans list of languages used
Other projects in Smalltalk
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark