Back to Contents

Getting Ready

This book is about teaching the computer to do new things by writing computer programs. Just as there are different languages for humans to speak to one another, there are different programming languages for humans to speak to computers.

We are going to be using a programming language called OCaml. It might already be on your computer, or you may have to find it on the internet and install it yourself. You will know that you have OCaml working when you see something like this:

OCaml

#

OCaml is waiting for us to type something. Try typing 1 + 2;; followed by the Enter key. You should see this:

OCaml

# 1 + 2;;
- : int = 3

OCaml is telling us the result of the calculation. To leave OCaml, give the exit 0 command, again ending with ;; to tell OCaml we have finished typing:

OCaml

# exit 0;;

You should find yourself back where you were before. If you make a mistake when typing, you can press Ctrl-C (hold down the Ctrl key and tap the c key). This will allow you to start again:

OCaml

# 1 + 3^CInterrupted
# 1 + 2;;
- : int = 3

We are ready to begin.