Git Product home page Git Product logo

gnu_smalltalk_koans's Introduction

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.

Support for Windows is on its way (once I figure out how to build it successfully).

Installing GNU Smalltalk on Mac OS X

The simplest way to install GNU Smalltalk is via homebrew:

brew install gnu-smalltalk

You can also install it via MacPorts.

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.4 source from ftp://ftp.gnu.org/gnu/smalltalk.

autoreconf -vi
./configure
make
sudo make install

Test by running gst and interact with the REPL.

Running koans

In the root directory of the project, type:

script/run

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

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.

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.

Future Plans

  • Rewrite the runner (make it smarter, faster, stronger)
  • Add an answer sheet
  • Add color to output

There is no set time, but I plan to port these koans over to the following Smalltalk dialects:

  • Pharo/Squeak
  • redline?
  • Jtalk?

Inspiration and Credits

GNU Smalltalk Koans were inspired by Edgecase's Ruby Koans and Aaron Bedra's Clojure Koans (now maintained by Colin Jones).

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

Other thanks:

License

cc-license

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

gnu_smalltalk_koans's People

Stargazers

Mitchelle Pascual avatar

Watchers

Mitchelle Pascual avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.