No description
  • Common Lisp 97.4%
  • NewLisp 1.9%
  • Shell 0.7%
Find a file
2017-07-18 10:45:46 +03:00
koans passing multiple values koans 2017-07-18 10:45:46 +03:00
.gitignore Update ignores 2017-06-09 20:29:08 -05:00
.koans Moves :format lesson later in the curriculum. 2016-02-28 17:40:01 +08:00
contemplate.lsp Corrected package name collision problem exposed by clisp (Thanks clisp!). 2017-03-03 15:20:06 +01:00
LICENSE first commit. 2013-05-24 16:42:09 -04:00
lisp-unit.lsp Deleted trailing whitespaces. 2017-03-03 15:08:49 +01:00
meditate.sh Ignore backup file events 2017-06-10 09:58:02 -05:00
README.md Improve awkward wording and fix typos... 2017-06-13 14:51:52 -05:00
TODO update todo to add item about error reporting 2013-06-06 11:49:37 -03:00
unused-test-ideas.lsp first commit. 2013-05-24 16:42:09 -04:00

Lisp Koans

Getting Started

One-time Method

From a terminal, execute your lisp interpreter on the file 'contemplate.lsp' e.g.

abcl --noinform --noinit --load contemplate.lsp --eval '(quit)'
ccl -n -l contemplate.lsp -e '(quit)'
clisp -q -norc -ansi contemplate.lsp
ecl -norc -load contemplate.lsp -eval '(quit)'
sbcl --script contemplate.lsp

Watching the Koans

On Linux systems, the shell script meditate.sh can be used to automatically evaluate 'contemplate.lsp' whenever the koan files are modified, providing immediate feedback on changes to the koans. From a terminal:

$ cd lisp-koans
$ sh meditate.sh

Results of Contemplation

Running on a fresh version should output the following:

Thinking about ASSERTS
    ASSERT-TRUE requires more meditation.

You have not yet reached enlightenment ...
  A koan is incomplete.

Please meditate on the following code:
   File "koans/asserts.lsp"
   Koan "ASSERT-TRUE"
   Current koan assert status is "(INCOMPLETE)"

You are now 0/169 koans and 0/25 lessons closer to reaching enlightenment

This indicates that the script has completed, and that the learner should look to asserts.lsp to locate and fix the problem. The problem will be within a define-test expression such as

(define-test assert-true
    "t is true.  Replace the blank with a t"
    (assert-true ___))

In this case, the test is incomplete, and the student should fill in the blank (____) with appropriate lisp code to make the assert pass.

In order to test code, or evaluate tests interactively, students may copy and paste code into the lisp command line REPL.

Quoting the Ruby Koans instructions

"In test-driven development the mantra has always been, red, green, refactor. Write a failing test and run it (red), make the test pass (green), then refactor it (that is look at the code and see if you can make it any better). In this case you will need to run the koan and see it fail (red), make the test pass (green), then take a moment and reflect upon the test to see what it is teaching you and improve the code to better communicate its intent (refactor)."

Content

The Common Lisp koans are based on the python koans and ruby koans projects. Additionally, many of the tests are based on new material that is special to Common Lisp.

Note that the unit on threads uses an SBCL specific threading API. A reader macro will remove this unit on Lisp implementations other than SBCL.