Is Lisp a functional programming language?

(Note:  We may earn commissions from products/services you click on.  This is at no extra cost to you.)

Table of Contents

Lisp is the oldest family of imperative and functional languages. Originally developed as a practical model to represent programs (in contrast to the theoretical notion of the Turing Machine), it became in the 1970s and 80s the language of choice for research in artificial intelligence.
In 1958, John Mac Carthy and his team implemented the first LISP interpreter ( LIS t Processing or, for slanderers, Lots of Idiots and Stupid Parenthesis) based on the theory of lambda-calculus. Dedicated to solving problems that could not be solved by FORTRAN (main thanks to recursion), Lisp is at the origin of a lot of progress in theoretical computer science. Object-oriented programming derives from functional languages: Smalltalk, the first object language popularized, was written in Lisp.

Lisp is a so-called prefixed language: the functional is always in the first position, which facilitates parsing. The basic kernel comprises very few instructions (defun, car, cdr, cons, cons, and basic operators). It is, therefore, a relatively simple but very expressive language:

(+ 5 3)
-> 8
(/ 8 2)
-> 4
(defun f (x) (* xx))
-> define a function f which takes an argument x and which returns x * x
Many variations of Lisp have been developed over time. The most popular today is GNU Common Lisp. Lisp is also the macro language in emacs (a popular Unix text editor) or its AutoLisp version, the macro language in AutoCAD.
First-class function
To be first-class is therefore to have the same status as a value such as an integer or a character, that is to say:

To be able to be named, assigned (and typed):
x = sin

Can be defined and created on demand:
x = lambda x: x + 1

Can be passed as an argument to a function:
map (lambda x: x * x, [1, 3, 4])

To be able to be the result of a function:
(f (3)) (5)

Be able to be stored in any data structure:
array = [log, exp, tan]

Is Lisp a functional programming language
Is Lisp a functional programming language

Is Lisp a purely functional language?

LISP is the first high-level programming language based on the functional paradigm Created in 1958 by John McCarthy.

LISP is a revolutionary language and introduces new programming concepts: functions as primitive objects, higher-order functions, polymorphism, lists, recursion, symbols, data and program homogeneity, “read-evil-print” loop.

Improve your skills.  Click this affiliate link to register for the Data Scientist Masters Program.

The inheritance of LISP reaches languages ​​derived from it (Scheme, Golden Common LISP) and new non-strictly functional paradigm languages, such as C #, Python, Ruby, or Scala.

LISP is not a pure functional programming

There are other more pure functional languages: Haskell, Miranda, ML

In LISP (and Scheme), some instructions go beyond the pure functional paradigm and allow local state and side effects

  • LISP is richer than purely available programming
  • Characteristics of the functional paradigm
  • Declarative programming
  • Recursion
  • Functions as primitive data types
  • Declarative programming vs. imperative

Imperative programming: execution steps and variable status:

int x = x + 1;

int y = y + 3;

(define (square x)

   (* xx))

Local state example (does not exist in declarative programming):

int function counter () {

   static int c = 0;


   c ++;

   return c;



counter (): 1

counter (): 2

counter (): 3

Declarative programming: Within the declaration scope of the variables x1 … xn all occurrences of an expression e that contains only the variables x1 … xn have the same value.

Consequence: optimization. If an e expression appears in multiple places within the same scope, it only needs to be evaluated once.


(define (double x) (+ xx))

(define (square y) (* yy))

(define (fz) (+ square (double z)) 1))

However, Lisps is more like a multilingual toolkit: you can perform functional programming, OOP, logic programming, define your DSL for some weird new paradigms, etc.

The closest Lisp to functional programming style is Clojure (it has lazy evaluation, discourages OOP, always uses immutable data structures, limits uncontrolled mutations (via STM), and has many pure/higher-order functions in the core library and many more.)

However, Python, Lisp does not perform purely functional, allowing variable variables, status, and command construction. It is always convenient to mix styles in practice, so you may not find many examples—pure concept in a very successful tool.

What type of programming language is Lisp?

LISP is a general-purpose, high-level computer programming language that has monopolized the application of artificial intelligence for a long time. As a language designed to apply artificial intelligence, LISP is the first declarative in-system functional programming language, different from imperative in-system procedural C and Fortran, and object-oriented Java, C# other structured programming languages.

LISP name from the list of English abbreviations processing (LISt Processing), the pioneer of artificial intelligence research from the Massachusetts Institute of Technology John McCarthy (John McCarthy) based on 1958 λ calculus created using abstract data list with recursive make symbolic computation To derive artificial intelligence

Become an industry expert.  Click this affiliate link to register for the Data Analyst Masters Program.

LISP is a functional programming language, and all operations can be implemented in a way that functions act on parameters.

LISP does not have joint assignment statements and variables in imperative language programs. The repeated process can be represented by recursive function calls without the need to use the loop mode.

LISP is an ancient functional language, weak typing, dynamic inference, and its code itself is a variety of lists. Each table item can store any type of data such as numbers, functions, symbols, or a sub-table, etc.; during encoding, you can operate at any time to update the list.

LISP core operator only seven operators: quote, atom, eq, car, cdr, cons, cond. The first three, quote, particle, and eq, are used for symbol inference; car, cdr, and cons manipulate the table; cond is responsible for branch judgment. This concise definition is very close to the pure functional language of the Turing machine prototype, which is completely unmatched by modern languages.

The relative disadvantage of LISP as an invalid type is its low operating efficiency. The shortcomings of the simple original definition make it difficult for large-scale development projects. From the bottom to the high level, from two-dimensional table query to object-oriented, users need to embed more functions to achieve this, resulting in the derivation of many LISP dialects.

What is Lisp used for?

Long ago, this language stood at the forefront of computer science research, especially in artificial intelligence research. Now, it is rarely used. All this is not because ancient, similar ancient languages ​​are widely used. Other similar ancient languages ​​are FORTRAN, COBOL, LISP, BASIC, and the ALGOL family. The only difference between these languages ​​is who they are designed for. FORTRAN is designed for scientists and engineers. The purpose of programming on computers is It is to solve problems. COBOL is designed for business, and the best embodiment is to allow business people to use the computer age. LISP is designed by computer science research, and the most prominent embodiment is the research on the basic principles of computers. BASIC is designed for beginners. Finally, the ALGOL language is modified by computer programmers and evolved into a huge family of other popular languages ​​such as C, Pascal, and Java. Some of the languages ​​mentioned above are not as popular anymore. We can call them “failures” here. The question is, why do they fail? The first one that came out was COBOL. Unfortunately, its good readability for business people is its failure point. Business people find that they can hire programmers to manage their systems. Programmers will naturally prefer the language designed for them rather than their boss. So over time, more and more commercial functions are implemented using VB, C, C++, and JAVA. Now, only a small part of the software is still written in COBOL language.

BASIC has a different fate. He is designed for beginners. Those who learn programming on a microcomputer will use the built-in BASIC language as a starting point. Over time, microcomputers were replaced by personal computers running Microsoft operating systems or Apple computers running macOS. VB gradually replaces this language. Although he is geared towards junior programmers, it has replaced COBOL for a while.

What programming languages are functional?

If you spend a lot of time reading programming trends on the Internet, you will have heard of functional programming. This word is often used, but what does it mean?

Even if you know what functional programming is, you may not know which language is best for it. After all, not all programming languages ​​are the same. Although you can apply functional programming paradigms in multiple languages, some areas will still make you feel more comfortable.

Become an industry expert.  Click this affiliate link to register for certification in a Practical Introduction to Programming and Problem Solving.

In actual programs, sometimes this makes sense. Since it is not always clear what is changing state or data, it makes the program more difficult to maintain. Functional programming was originally used in academic environments, but it can also help prevent such problems.


Some programming languages ​​allow functional programming, while others encourage or even enforce it. JavaScript belongs to the first category. Although you can use the functional programming paradigm in the language, you can also easily use an object-oriented approach.

In other words, JavaScript has many built-in functional programming paradigms. Take higher-order functions as an example. These functions can use other functions as parameters.

JavaScript Some functions may be used with arrays, e.g., map(), reduce(),

SQL-Structured Query Language

SQL- Structured Query Language is a language that the database can understand. IBM engineers developed SQL in 1970 to create, update and retrieve data in the “System R” database management system. Since then, SQL has come a long way, and to this day, it is still the most needed skill in the market.

C#-the number one Microsoft technology

C# is one of the universal languages, it makes programming as easy as the Java language. C# is a type-safe, object-oriented programming language that runs in the runtime environment of the .NET framework. The C# code is compiled into IL language (intermediate language) that conforms to the CLI specification.


Many people think that PHP is not the future of programming, but the huge ecosystem of PHP makes the world need many developers to support it in the next few years. The top three content management systems-Word Press, Drupal, and Joomla are all built with PHP, and so far, about 80% of websites run on PHP. So, it is enormous!

What is a functional programming example?

Functional programming (also known as FP) is a way of thinking about software construction by creating pure functions. It avoids the concept of shared state and mutable data observed in object-oriented programming.

Functional languages ​​experiment with expressions and declarations rather than the execution of statements. Therefore, unlike other processes that rely on local or global states, the value output in FP depends only on the parameters passed to the function.

Functional programming language

The goal of any FP language is to imitate mathematical functions. However, the basic process of calculation is different in functional programming.

Here are some of the most famous functional programming languages:

  • Haskell
  • SML
  • Clojure
  • ladder
  • Erlang
  • clean
  • F#
  • ML/OCaml Lisp/Scheme
  • XSLT
  • SQL
  • Mathematica

Referential transparency

The functional program should operate the first time. Therefore, you will know what may or may not happen during the program’s execution and its side effects. In FP, this is called referential transparency.


Modular design improves productivity. Small modules can be coded quickly and have more significant opportunities for reuse, which will undoubtedly lead to faster development of the program. In addition, modules can be tested individually, which helps you reduce the time spent on unit testing and debugging.


Maintainability is a simple term, which means that FP programming is easier to maintain because you don’t need to worry about accidentally changing anything other than a given function.

First-class features

“The first-class function” is a definition due to the unlimited use of programming language entities. Therefore, first-class functions can appear anywhere in the program.

shut down

A closure is an internal function; even after the parent function is executed, it can access the variables of the parent function.

Higher-order function

Higher-order functions either take other functions as parameters or return them as results.

Higher-order functions allow partial applications or applications. This technique applies one function to its parameters because each application returns a new process that accepts the following parameter.

Pure function

A “pure function” is a function whose input is declared input, and no input should be hidden. The output is also displayed as output.

Pure functions act according to their parameters. If nothing is returned, the efficiency is not high. Moreover, it provides the same output for a given parameter.


Lisp programming example

Lisp is the second-oldest high-level programming language after Fortran. Significant changes have taken place since its inception, and some dialects have always existed in its history. Today, the most widely known and commonly used dialects of Lisp: Common Lisp and Scheme.

John McCarthy invented the lisp in 1958 at the Massachusetts Institute of Technology (MIT).

This reference will take you through practical and straightforward methods while learning the Lisp programming language. 

Lisp is a language with a long history; its full name is LISt Processor, “table processing language.” It is a language designed by John McCarthy in 1958. Many languages ​​that appeared simultaneously or later than Lisp, such as Algo, have mostly died out or only have some trivial uses on some specific occasions. I am afraid that only FORTRAN and COBOL are still widely known. But Lisp alone not only hasn’t declined over time; on the contrary, it has been rejuvenated again and again. Languages ​​such as Scheme and ML branched from Lisp are more popular than many old celebrities on many occasions. So, where is the secret of eternal youth for this evergreen tree? 

If you have only been exposed to “procedural languages” such as C/C++ and Pascal, Lisp may make you feel very unusual. The first thing that attracts your attention (or confusing you) must be the vast number of parentheses in Lisp programs. Of course, from the current point of view, this design is indeed not very friendly to programmers, but considering the computer processing power of the 1950s and 1960s, simplifying the creation of the language itself was considered a top priority at that time.

  • Features of Common Lisp
  • This is machine-independent
  • It uses an iterative design method and is easy to expand.
  • It allows dynamically updated programs.
  • It provides high-level debugging.
  • It provides advanced object-oriented programming.
  • It provides a convenient macro system.
  • It provides a wide range of data types for objects, structures, lists, vectors, adjustable arrays, hash tables and symbols.
  • It is based on expression.
  • It provides an object-oriented system condition.
  • It provides a complete I/O library.

Lisp syntax

Lisp programs are composed of three basic building blocks:




An atom is a continuous character or string of numbers. It includes numbers and special characters.

Here are some examples of valid atoms:







A list is a sequence of atoms and/or other lists contained in parentheses. Here are some examples of valid lists:

( i am a list)

(a ( a b c) d e fgh)

(father tom ( susan bill joe))

(sun mon tue wed thur fri sat)

( )

A string is a set of characters enclosed in double quotes. The following are some examples of valid strings:

” I am a string”

“a ba c d efg #$%^&!”

“Please enter the following details :”

“Hello from ‘Tutorials Yiibai’! “

Add notes

The semicolon symbol (;) is used to indicate a comment line.


(write-line “Hello World”) ; greet the world

; tell them your whereabouts

(write-line “I am at ‘Tutorials Yiibai’! Learning LISP”)

When you click the Execute button, or press Ctrl+E, LISP executes it immediately, and the result returned is:

Hello World

I am at ‘Tutorials Yiibai’! Learning LISP

Some notable points before moving on to the next section

  • The following are some key points to note:
  • The basic mathematical operations in the LISP language are +, -, *, and /
  • Lisp is actually a function call f(x) is (fx), for example cos(45) is written as cos 45
  • LISP expressions are not case sensitive, cos 45 or COS 45 are the same.

LISP tries to calculate everything, including the parameters of the function. Only three types of elements are constants and always return their own values:


The letter t, which means logical truth

The value is nil, which means logical false, and there is an empty list.

A little introduction to the LISP form

In the previous chapters, we mentioned that the following steps are taken during the calculation of the LISP code:

The reader converts characters into strings or s-expressions of LISP objects.

Evaluators are defined as those Lisp syntax forms built from s-expressions. The grammar for calculating the second level definition determines that the S-expression is in the form of the LISP language.

  • Now, the form of a LISP can be:
  • An atom
  • Empty or not list
  • Any list that has a symbol as its first element

The evaluator can be used as a function; it accepts a valid LISP language form as a parameter and returns a value. This is why we express the LISP language in parentheses because the entire expression/form we want to send is evaluated as a parameter.

LISP naming convention

The name or symbol can contain any number of whitespace compared to other alphanumeric characters such as opening and closing brackets, double and single quotes, backslashes, commas, colons, semicolons, and vertical bars. To use these characters in the name, you need to use the escape character ().

A name can contain numbers, but not all numbers, because then it will be interpreted as a number. The same word can have a cycle, but the cycle cannot be thoroughly carried out.


The grammatical structure of Lisp makes the data and the program just a line of separation (quote is the data, without the quotation is the program). Because of Lisp’s concept of “data is a program, the program is data”, Lisp’s macro (Macro) becomes very flexible: you can define a macro and specify what it should be translated by the compiler (macro expansion) into Programs, programs, and data can be flexibly converted to each other, and the final expanded code will become part of the entire program. The realization of macros relies heavily on quotes. When you define a macro, the macro quote part of the compiler will first be unquote; without the quote, unquote part, or has been, it will first be evaluated. The entire program code generated by the final compiler is the last code to be executed. The following uses the widely used Emma’s Lisp as an example (the following criteria are also compatible with Common Lisp) to explain the most basic Lisp macros.

The final result is “unlimited programming in an eyeful” (in the lower half of page 13 of the Lisp 1.5 manual). The key to the problem is not “Lisp” but whether these representative methods are open to multiple programming language solutions.

Once this is done, you can immediately consider a programming language better than Lisp, and you will directly come up with a better way to write Meta descriptions than John. This is the so-called “POV = 80 IQ points” part. But this sounds like the electrodynamics’ theory of relativity once you see Newton. So the most significant feat in science is Newton!

 This is why Lisp is the best.

Luis Gillman
Luis Gillman

Hi, I Am Luis Gillman CA (SA), ACMA
I am a Chartered Accountant (SA) and CIMA (SA) and author of Due Diligence: A strategic and Financial Approach.

The book was published by Lexis Nexis on 2001. In 2010, I wrote the second edition. Much of this website is derived from these two books.

In addition I have published an article entitled the Link Between Due Diligence and Valautions.

Disclaimer: Whilst every effort has been made to ensure that the information published on this website is accurate, the author and owners of this website take no responsibility  for any loss or damage suffered as a result of relience upon the information contained therein.  Furthermore the bulk of the information is derived from information in 2018 and use therefore is at your on risk. In addition you should consult professional advice if required.