PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Common Lisp

Common Lisp

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

#88on PLDB 38Years Old 1.9kUsers
6Books 0Papers 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:
(DEFUN HELLO () (PRINT 'HELLO))
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 Example Token
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
; https://eli.thegreenplace.net/2016/a-polyglots-guide-to-multiple-dispatch-part-3/
(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)
Semantic Indentation ϴ

Books about Common Lisp on goodreads

title author year reviews ratings rating
Paradigms of Artificial Intelligence Programming: Case Studies in Common LISP Peter Norvig 1991 9 439 4.33
Programming In Common Lisp Rodney A. Brooks 1985 0 1 4.00
Common LISP: Common LISP Implementations, Common LISP Publications, Common LISP Software, Cyc, Maxima, Kyoto Common LISP, Acl2, Genera, ACT-R Source Wikipedia 0 0 0.0
A Programmer's Guide To Common Lisp Deborough G. Tatar 1987 0 0 0.0
Common Lisp Programming Steve Howard 2012 0 4 3.25
Object-Oriented Programming in Common LISP: A Programmer's Guide to Clos Sonya E. Keene 1989 4 48 4.02
smali.html · common-lisp.html · apl.html

View source

PLDB - Build the next great programming language · v2022 · Day 31 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com