Top 1,000 Features Creators Resources Extensions Blog Explorer CSV Download
GitHub icon

Common Lisp

< >

Common Lisp is a programming language created in 1984 by Scott Fahlman and Richard P. Gabriel and David A. Moon and Kent Pitman and Guy Steele and Dan Weinreb.

#156on PLDB 40Years Old 24kRepos

Try now: Riju

Common Lisp (CL) is a dialect of the Lisp programming language, published in ANSI standard document ANSI INCITS 226-1994 (R2004) (formerly X3.226-1994 (R1999)). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived from the ANSI Common Lisp standard. The Common Lisp language was developed as a standardized and improved successor of Maclisp. Read more on Wikipedia...

Example from Riju:
(format t "Hello, world!")
Example from hello-world:
(defun hello-world () (format t "Hello World~%")) (hello-world)
Example from Linguist:
Example from Wikipedia:
CL-USER > (available-shells) (#P"/bin/bash" #P"/bin/csh" #P"/bin/ksh" #P"/bin/sh" #P"/bin/tcsh" #P"/bin/zsh")

Language features

Feature Supported Token Example
Print() Debugging โœ“ PRINT
Line Comments โœ“ ;
; A comment
Multiple Inheritance โœ“
Directives โœ“
Comments โœ“
Multiple Dispatch โœ“
 (defmethod collide-with ((x asteroid) (y asteroid))
  ;; deal with asteroid hitting asteroid
(defmethod collide-with ((x asteroid) (y spaceship))
  ;; deal with asteroid hitting spaceship
(defmethod collide-with ((x spaceship) (y asteroid))
  ;; deal with spaceship hitting asteroid
(defmethod collide-with ((x spaceship) (y spaceship))
  ;; deal with spaceship hitting spaceship
Single Dispatch โœ“
(defclass Person () ())
(defmethod frobnicate ((p Person) record spreadsheet)
 (format t "~a ~a ~a~&" (type-of p) (type-of record) (type-of spreadsheet)))
(defclass Asteroid () ())
(defmethod frobnicate ((a Asteroid) velocity size)
 ; do stuff
; At runtime these 2 would be routed to respective methods:
(frobnicate a-person his-record big-spreadsheet)
(frobnicate an-asteroid very-fast pretty-small)
Lispy โœ“
Semantic Indentation X

View source

- Build the next great programming language ยท About ยท Acknowledgements ยท Published by Breck's Lab