Lisp is a family, and its files share the parenthesised look and often the extensions .lisp, .lsp and .cl. The viewer reads the text of such a file and names the dialect it finds. It colours the dialects that have their own page on this site, and shows the rest as plain text under their own name. Each name below is what the viewer calls the file.
Dialects with their own pages
- Emacs Lisp (
.el; “Emacs Lisp source file”) – the extension language of GNU Emacs. Marks:(provide 'name),(require 'name),defcustom,use-package,add-hook,interactive,save-excursion,lexical-binding: tand the;;; file.el --- titleheader. - Scheme (
.scm,.ss; “Scheme source file”) – the small, lexically scoped dialect with one namespace. Marks:(define (f x) …),define-syntax,syntax-rules,call/cc,set!,#tand#f,(let loop …). - Racket (
.rkt; “Racket source file”) – a Scheme descendant. Mark: a#langline, andfor/listand similar forms. - Clojure (
.clj,.cljs,.cljc; “Clojure source file”) – a Lisp for the Java virtual machine and JavaScript, with vectors and maps. Marks:(ns name (:require [lib :as x])),(defn name [args] …),{:key value}.
Dialects named but not described here
AutoLISP and Visual LISP
Autodesk’s extension language for AutoCAD since 1986, based on an early version of XLISP, and also read by BricsCAD, ZWCAD, GstarCAD and others. Files are .lsp (source), .mnl (code that runs with a menu), .fas and .vlx (compiled) and .dcl (dialog definitions, a separate language). It has no packages or objects; names are case-insensitive; (defun c:name () …) defines a command that can be typed in AutoCAD; local variables are written after a slash in the parameter list ((defun f (a b / x y) …)); and ;| … |; is a block comment, which makes ;| the way to tell AutoLISP from Common Lisp. Functions have fixed prefixes: vl- and vlax- (Visual LISP and its ActiveX interface), vla- (ActiveX methods), ent… (entget, entmake), ss… (selection sets), get… (getpoint, getstring), and (command "_line" p1 p2 "") runs AutoCAD commands. The viewer names these files “AutoLISP source file” and shows them without colour.
ISLISP
The ISO/IEC 13816 standard (1997, revised 2007): a small Lisp built to be a common core of Lisp dialects, with classes (ILOS) and conditions, and Common Lisp-like syntax. Classes are written between angle brackets (<string>, <integer>); there are defglobal and defdynamic (global and dynamic variables, read with (dynamic name)), dynamic-let, and with-handler. Implementations include OpenLisp and Easy-ISLisp (by Kenichi Sasagawa).The viewer names these “ISLISP source file”.
PicoLisp
Alexander Burger’s Lisp, built around a database and a small interpreter; files are usually .l. Functions are defined with (de name (args) …) and methods with (dm name> (args) …); classes are written (class +Name); # starts a comment. The viewer names a .lsp or .lisp file that shows these marks “PicoLisp source file”.
newLISP
Lutz Mueller’s scripting Lisp. Files are .lsp and may start with #!/usr/bin/newlisp. It uses define for functions and (context 'Name) for namespaces, and has {text} and [text]…[/text] strings. The viewer names it “newLISP source file”.
Interlisp
The dialect of BBN and Xerox PARC (Interlisp-10, Interlisp-D, now Medley Interlisp). Source files are written by the system’s file package: (FILECREATED …), then (DEFINEQ (name (LAMBDA (args) …)) …) with upper-case names, (RPAQQ …) and (PUTPROPS …) forms, and a COMS list that says what is on the file. Compiled files are .lcom and .dcom (per machine). The viewer names it “Interlisp source file”.
Lisp Machine Lisp and Zetalisp
The language of MIT’s and Symbolics’s Lisp Machines, ancestor of Common Lisp and still read by Genera. Marks are a mode line with Syntax: Zetalisp (or Readtable: ZL), the flavor system (defflavor, defmethod (flavor :message), (send object :message)), defselect, defwrapper, and packages such as zl:, si:, tv:. A Symbolics file with Syntax: Common-Lisp is Common Lisp and is read as such. The viewer names it “Lisp Machine Lisp source file”.
How the viewer chooses
For .lisp, .lsp, .asd and .ros files the viewer reads the first 128 KB of text and counts marks, patterns that one dialect has and the others do not, each with a weight. A different dialect is chosen only when its marks add up to at least 6 and clearly beat the marks of Common Lisp (defpackage, in-package, defclass, #+sbcl, &key, (format t "…"), (declare (type …)) and others); a Racket #lang line or a #!/usr/bin/newlisp line decides at once. A short text or a plain list is Common Lisp. A .cl file is Common Lisp or OpenCL C, and a .cl file whose first comment is an ML-style (* … *) is shown plain.
The test on this Mac found about 380 .lisp files that all read as Common Lisp, about 200 .lsp files that read as Common Lisp (most are the scripts of the game Abuse, written in a Lisp of its own that looks like Common Lisp, which the viewer cannot tell apart), and the .el, .scm, .clj and .rkt files, where those that do not name their own dialect are mostly not that language (tree-sitter queries in .scm files).