Skip to content

Common Lisp is a powerful, multi-paradigm programming language. It is known for its flexibility and for being a standard for the Lisp family of languages, one of the oldest programming languages still in use today

License

Notifications You must be signed in to change notification settings

Srujanrana07/Common-LISP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Common Lisp

Common Lisp Logo

What is Common Lisp?

Common Lisp is a powerful, multi-paradigm programming language. It is known for its flexibility and for being a standard for the Lisp family of languages, one of the oldest programming languages still in use today. Lisp (LISt Processing) was originally designed in the late 1950s by John McCarthy for artificial intelligence research and has evolved into a language that is widely used for symbolic computation, data processing, and academic research.

Key Features of Common Lisp:

  1. Dynamic Typing: Variables do not have a fixed type; their types are determined at runtime.
  2. Garbage Collection: Automatic memory management helps avoid manual memory allocation/deallocation.
  3. Rich Data Structures: Supports powerful data structures like lists, arrays, hash tables, etc.
  4. Macros: Allows you to define new language constructs, providing metaprogramming capabilities.
  5. Interactive Environment: Typically uses an interactive REPL (Read-Eval-Print Loop) to run code in an iterative manner.
  6. Portable: As a standardized language, Common Lisp can run on various platforms with minimal changes to code.

Syntax Overview

Here's an example of a simple "Hello, World!" program in Common Lisp:

(defun hello-world ()
  (format t "Hello, World!"))
  
(hello-world)

Data Types in Common Lisp

Common Lisp supports several fundamental data types:

  • Numbers: These include:

    • Integer: Whole numbers, e.g., 42
    • Float: Real numbers with fractional parts, e.g., 3.14
    • Rational: Numbers expressed as the ratio of two integers, e.g., 1/2
  • Strings: Sequences of characters, e.g., "Hello, World!"

  • Symbols: Named identifiers that are used to represent variables, functions, or constants, e.g., x, foo, bar

  • Lists: The core data structure in Lisp, represented as ordered collections of elements. Lists are written as (a b c)

  • Vectors: Arrays with fixed sizes, e.g., #(1 2 3 4)

  • Hash Tables: Key-value pairs, useful for fast lookups. Example:

    (setq my-hash (make-hash-table))
    (setf (gethash 'key my-hash) 'value)

Why Learn Common Lisp?

  • Flexibility: Its combination of functional, procedural, and object-oriented programming paradigms allows developers to choose the best tool for the job.
  • Robustness: Common Lisp is known for its reliability, with many large systems and projects using it for mission-critical applications.
  • Mature Ecosystem: Although not as widespread as other languages, Common Lisp has a long history with a number of libraries, frameworks, and tools available.

Getting Started with Common Lisp

To start working with Common Lisp, you can install implementations like:

REPL (Read-Eval-Print Loop)

The REPL is an interactive environment that makes Common Lisp especially enjoyable for rapid prototyping and experimentation. You can enter expressions directly and get immediate feedback.

Contributing to Common Lisp

If you're interested in contributing to the Common Lisp ecosystem, you can start by exploring various open-source Common Lisp projects. There are many libraries, frameworks, and implementations that welcome contributions from new developers.

You can contribute to the Common Lisp project here.

Contributor Badge

Resources for Learning Common Lisp

About

Common Lisp is a powerful, multi-paradigm programming language. It is known for its flexibility and for being a standard for the Lisp family of languages, one of the oldest programming languages still in use today

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published