The Wayback Machine - https://web.archive.org/web/20240123092308/https://www.geeksforgeeks.org/introduction-to-lisp/
Open In App
Related Articles

Introduction to LISP

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Lisp is a programming language that has an overall style that is organized around expressions and functions. Every Lisp procedure is a function, and when called, it returns a data object as its value. It is also commonly referred to as “functions” even though they may have side effects.

Lisp is the second-oldest high-level programming language in the world which is invented by John McCarthy in the year 1958 at the Massachusetts Institute of Technology.

Features of  LISP Programming Language:

  1. It is a machine-independent language
  2. It uses iterative design methodology and is easily extensible
  3. It allows us to create and update the programs and applications dynamically.
  4. It provides high-level debugging.
  5. It supports object-oriented programming.
  6. It supports all kinds of data types like objects, structures, lists, vectors, adjustable arrays, set, trees,hash-tables, and symbols.
  7. It is an expression-based language
  8. It can support different decision-making statements like if, when,case, and cond
  9. It will also support different iterating statements like do, loop,loopfor, dotimes and dolist.
  10. It will support input and output functions
  11. By using lisp we can also create our own functions

These are the features of LISP Programming.

Hello World program in LISP:

we can start writing  a string by using the write-line method

Syntax:

(write-line string)

Example:

Lisp




;this is a comment
(write-line "Hello Geeks")


Output:

Hello Geeks

Naming Conventions:

The naming Conventions mean the way we are declaring variables in a program. It includes the variable names and syntax formats

Lets us discuss the conventions

  • A variable can contain  any number of alphanumeric characters other than whitespace, open and  closing parentheses

Example:

Acceptable – hello,saisravan, etc

Not Acceptable – hell()0,sat{ sravab{,,,,,,,,etc

  • A variable can not contain double and single quotes, backslash, comma, colon, semicolon, and vertical bar.

Example:

Acceptable – hello,saisravan, etc

Not Acceptable – hell””)0,sat//*& sra//>vab{,,,,,,,,etc

  • A variable can not start with a digit but. it can contain any number of digits

Example:

Acceptable – hello88Geeks, r56lisp, ,,,,,etc

Not Acceptable – 40geeks,4klll,….etc

Example Code: For acceptable names

Lisp




;acceptable naming conventions
(write-line "hello")
 
(terpri)
 
;acceptable naming conventions
(write-line "hello99")
 
(terpri)
 
;acceptable naming conventions
(write-line "hello geeks")
 
(terpri)
 
;acceptable naming conventions
(write-line "hello_Geek")
 
(terpri)
 
;acceptable naming conventions
(write-line "hello123")


 Output:

hello
hello99
hello geeks
hello_Geek
hello123

Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!


Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 17 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials