Getting Started with Lisp

Korey Hinton –> My Blog –> Lisp –> Getting Started with Lisp

April 5, 2014


Download and Install Racket

chmod +x


Launch DrRacket from the path you set-up during installation.


Interactive Shell

Click No language chosen > Choose language to choose a language. Pick The Racket Language option and press OK. Notice that the language is now specified as:

#lang racket

Click Run.

Hello World
"Hello, world!"
Write first function

Let's write an add function that will add a list of numbers together. First, let's look at the built-in add function.

(+ 1 2 3)

Lisp is a language of lists. These lists are surrounded by parenthesis. The first item in a lisp list is the name of the function while the remaining items are sent as input or arguments to the function. So + is the method name and the numbers are the parameters. This operation performs the calculation by adding all numbers 1 + 2 + 3. So a C-like equivalent function would look like:

int add(int num1,int num2,int num3) { ... }

Although, this isn't completely accurate because the + lisp function takes in a list of numbers.

(define (add i . n)
     (null? n) i
     (apply add (cons (+ i (car n)) (cdr n)))))
(add 1 2 3)


Download and Run

cp clojure-1.6.0.jar clojure-master/
cd clojure-master
java -cp clojure-1.6.0.jar clojure.main

Hello World

(println "Hello, world!")

Date: 2014-04-06T06:38+0000

Author: Korey

Org version 7.9.3f with Emacs version 24

Validate XHTML 1.0