Lisp (programming language)
Lisp (used to be called LISP) is a programming language. It is among the oldest programming languages that are still used today. Only Fortran is one year older. Lisp was designed by John McCarthy in 1958. The best-known versions of LISP are Common Lisp, Scheme and Clojure. Many concepts that are used in modern programming languages were first created in Lisp. Linked lists are a very important data structure in Lisp. The basic concepts behind Lisp are easy to learn. Logo is another version of Lisp that was made for children. Logo can help young children develop skills and become efficient within the programming language.
Simple examples (Scheme)
In Lisp, operations are written in prefix notation, and they start and end with parentheses. For example, the formula is written as:
(/ (+ 3 5) 4)
Because Lisp is a functional language, Lisp programs often use recursion to solve problems. Here is a Scheme program that finds the factorial of a number. The function (factorial n) starts by testing if or not. If , then (factorial 0) is 1. If , then (factorial n) returns the product of and the factorial of .
(define (factorial n)
(if
(= n 0)
1
(* n (factorial (- n 1)))))
Here is a hello world program in Scheme:
(display "Hello world!")