Christopher B. Browne's Home Page
cbbrowne@acm.org

2. Common Lisp

Common Lisp is described by the ANSI X3J13 standard; it is a rather large, featureful, and complex language. It strove to be at least somewhat compatible with Lisp Machine Lisp, MacLisp , and Interlisp, which were three of the most widely used dialects at the time of its development.

It is a rather large, rich, and complex environment. To some, it is too large. (Mind you, if it is to be considered "bloated," what shall we say about C++? )

There is a Common Lisp Foundation , incorporated in the Netherlands, seeking to provide support for meetings and developments about CL.

2.1. CL Implementations

There are a wide variety of implementations of Common Lisp, of considerable maturity, including:

2.2. CL Documentation

2.2.1. Differences Between CLTL2 and ANSI - Version: 0

FAQ: How can I alter my copy of CLTL2 ([ Common Lisp the Language], 2nd edition, by G. L. Steele Jr., Digital Press, 1990) to note ANSI Common Lisp changes since its original publication?

This document describes how to alter (mark up or edit) your personal copy of CLTL2 to note new information from the ANSI Common Lisp standard. No guarantees on the completeness or accuracy of the information provided is expressed or implied. Use at your own risk. A doctored CLTL2 is NOT the ANSI standard. In fact, this FAQ has many known but minor omissions that are too awkward to add with pencil to CLTL2. My purpose in providing this information is to help you improve a familiar book and common source of information on Common Lisp. For information on ANSI Common Lisp I recommend these two sources: The Common Lisp HyperSpec , and Appendices C and D of the book [ANSI Common Lisp] by Paul Graham, Prentice-Hall, 1996 (a 2nd edition of this book was to be due out in April 1999). A third source used in the preparation of this FAQ is Appendix A of the [Allegro CL User Guide, Version 4.3], March 1996. This appendix is Franz's tally of the ANSI committee's votes. Franz also distributes an alternate html version of the ANSI Common Lisp Standard with the ACL 5.0 product. It covers the same material as the Hyperspec.

Send all comments, corrections, additions, complaints, etc. to .

Example of the notation used: p128,c2,ld4,lu7 translates to page 128, column 2, go 4 lines down from top and go 7 lines up from bottom.

  • ANSI replaced function get-setf-method with get-setf-expansion. ANSI renamed get-setf-method-multiple-value to get-setf-expansion. Note deletion: p144,ld9-lu8 get-setf-method definition Replace get-setf-[method -> expansion]: p133,ld3 p135,ld2,ld18 p137,ld1,lu2 p142,ld18,lu3 p143,ld4,ld8 p145,ld2?,ld8? p688,lu5 Replace get-setf-[method-multiple-value -> expansion]: p145,ld3,ld4

  • ANSI deleted the functions variable-information, function-information, declaration-information, augment-environment, parse-macro, and enclose as well as the macro define-declaration. This effectively deletes section "8.5 Environments:" p207,ld16-p214,lu1

  • ANSI deleted functions applyhook and evalhook along with the variables *applyhook* and *evalhook*. Note deletions: p179,lu15 p203,ld11 p490,ld9 p490,lu7 p491,ld12-p493,lu1 the definitions

  • ANSI deleted generic-flet, generic-function, generic-labels and with-added-methods. Note deletions: p73, Table 5-1, lu4,lu3 (in table) p216,lu12-lu9 p787,ld20-ld21 p787,lu15-p788,ld3 four small paragraphs p788,lu19-lu18,lu14 p844,lu5-p846,lu1 generic-flet, generic-function, generic-labels definitions p862,ld1-p863,ld8 with-added-methods definition

  • ANSI renamed define-setf-method to be define-setf-expander. Replace define-setf-[method -> expander]: p127,lu14 p128,ld6 p129,ld15,lu3 p131,ld8 p132,ld1,lu5 p133,ld8 p137,ld1 p141,lu6 p142,ld3,ld7,ld10,ld15,lu3 p143,ld5,lu15,lu10 p168,lu11,lu8 p216,ld1,ld15 p672,ld7 p688,lu11,lu8 p841,lu9

  • ANSI renamed special-form-p to special-operator-p. Replace special-[form -> operator]-p: p73,ld5 p119,ld18 p120,lu14,lu5,lu4 p121,ld1 p195,ld9

  • ANSI renamed simple-condition-format-string to simple-condition-format-control along with the condition initialization keyword :format-string to :format-control. Replace simple-condition-format-[string -> control]: p918,ld12,lu14,lu5 p919,ld1,lu3 Replace :format-[string -> control]: p887,ld11,lu9 p888,ld11 p891,lu13,lu8 p912,ld18 p915,ld6 p918,ld11,lu15,lu6 p919,lu5

  • ANSI renamed base-character to be base-char. Replace base-[character -> char]: p26,lu3 p27,ld2,ld4,ld5,ld8 p33,lu5,lu4 p39,lu5,lu4 p49,lu10 p50,ld15 p61,lu2 p62,ld2 p371,lu1 p647,lu14,lu7

  • ANSI renamed extended-character to be extended-char. Replace extended-[character -> char]: p27,ld1 p39,lu4 p49,lu11 p50,ld15 p371,lu1

  • ANSI deprecated the functions set and gentemp. Make note on definitions: p122,lu16 for set p246,ld13 for gentemp

  • ANSI restored the module facility. It is now only deprecated. Make note on section "11.8 Modules": p277,ld12-ld17

  • ANSI specifies the constant array-total-size-limit to be a fixnum. An argument to row-major-aref can therefore be declared as such. Note so at: p446,lu3

  • ANSI added a :print-object keyword argument to defstruct. Add to the bottom of p479: :print-object This option is like the existing :print-function one and takes a function as the keyword's argument. This function takes only the first two arguments described in :print-function. Only one of :print-object, :print-function, or :type can be used.

  • ANSI extends setf to take a values expression as the first argument. CLTL2 notes that a proposal to do so was made. Note that it was accepted on p129,ld18-ld23.

  • ANSI specifies many functions which must have proper lists (non-dotted lists). Note that these functions must have proper lists:

    • p171 mapcar

    • p171 maplist

    • p171 mapc

    • p171 mapl

    • p171 mapcan

    • p171 mapcon

    • p242 get-properties

    • p418 append (note: ANSI allows nconc to take dotted lists)

    • p426 member

    • p426 member-if

    • p426 member-if-not

    • p427 adjoin

    • p428 union

    • p428 nunion

    • p429 intersection

    • p429 nintersection

    • p429 set-difference

    • p429 nset-difference

    • p430 set-exclusive-or

    • p430 nset-exclusive-or

    • p431 subsetp

  • ANSI supplies a new data type boolean with members t and nil. Note so on bottom of p12 and p41. Add index entry: "boolean type, 12,41" to: p983,c3,lu26

  • ANSI changed arguments to make-load-form and make-load-form-saving-slots. Change p659,ld16 to: make-load-form object &key :environment [Generic Function] and change p662,lu9 to: make-load-form-saving-slots object &key :slots :environment [Function]

  • ANSI changed loop for/as - on end test from endp to atom: p721,ld11

  • ANSI added IEEE conditions floating-point-invalid-operation and floating-point-inexact as subconditions of arithmetic-error. Note on bottom of p922.

  • ANSI added allocate-instance a new generic function. Add to bottom of p848: allocate-instance class &rest initargs [Generic function]

    This generic function is like make-instance but does not initialize slots.

    Add index entry: "allocate-instance generic function, 848" to: p981,c2,ld22 p1024,c1,ld6

  • ANSI added array-displacement a new function. Add to bottom of p448: array-displacement array [Function]

    This returns two values. The first value is the array displaced to and the second is the displacement. If array is not a displaced array then array-displacement returns the values nil and 0.

    Add index entry: "array-displacement function, 448" to: p982,c1,lu1 p1019,c1,lu7

  • ANSI added constantly a new function. Add to bottom of p708: constantly object [Function]

    Returns a function that will always return the object. The returned function takes any number of arguments.

    Add index entry: "constantly function, 708" to: p987,c3,ld32 p1020,c2,ld10

  • ANSI added define-symbol-macro a new macro. Add to bottom of p214: define-symbol-macro symbol {form} [Macro]

    The symbol will act as a macro call. A single form constitutes the body of the expansion. The symbol cannot already be a special variable.

    Add index entry: "define-symbol-function macro, 214" to: p989,c3,ld20 p1026,c1,lu13

  • ANSI added ensure-directories-exist a new function. Add to bottom of p652: ensure-directories-exist file &key :verbose [Function]

    If the directories of file do not exist then this function creates them returning two values, file and a second value true if the directories were created or nil if not.

    Add index entry: "ensure-directories-exist function, 652" to: p991,c3,ld4 p1020,c3,ld4

  • ANSI added lambda a new macro. Add to bottom of p708: lambda lambda-list [[ {declaration}* | [doc-string]] {form}* [Macro]

    A dubious shortcut for (function (lambda ...)) or #'(lambda ...).

  • ANSI added read-sequence a new function. Add to bottom of p576: read-sequence sequence input-stream &key :start :end [Function]

    This function reads elements from input-stream into sequence. The position of the first unchanged element of sequence is returned.

    Add index entry: "read-sequence function, 576" to: p1007,c2,ld22 p1022,c2,lu7

  • ANSI added write-sequence a new function. Add to bottom of p577: write-sequence sequence output-stream &key :start :end [Function]

    This function writes elements of sequence to output-stream.

    Add index entry: "write-sequence function, 577" to: p1016,c2,ld30 p1023,c3,lu6

2.3. CL Code Samples

2.3.1. Socket Interfaces

There are a bunch of these; hopefully the interfaces may converge towards some common schemes that can be widely usable.

  • Socket Handling for Corman Lisp

    This package is a small set of CLOS classes that wrap the WINSOCK package available at the Corman Lisp web site. It allows creation of server sockets and client sockets in a fairly easy to use manner. It requires the winsock.lisp file available from the Corman Lisp web site. Support for using sockets through a proxy server is part of the package.

  • CLOCC PORT - Unified Cross-platform Socket API

Some interesting things have been implemented atop socket interfaces:

2.3.2. Meta Object Protocol

This is a scheme used to allow extending CLOS to make it more powerful.

Google
Contact me at cbbrowne@acm.org