-
Notifications
You must be signed in to change notification settings - Fork 10
/
frontmatter.tex
1274 lines (1138 loc) · 61.1 KB
/
frontmatter.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%Part{Char, Root = "CLM.MSS"}
%%% Chapter of Common Lisp Manual. Copyright 1984, 1988, 1989 Guy L. Steele Jr.
\def\pagestatus{ROUGH PAGES}
\begingroup
\makeatletter
\clearpage \global\c@page 5 % Start toc on page v
\def\numberline#1{\setbox0=\hbox{#1 }\ifdim \wd0 < \@tempdima
\hbox to \@tempdima{\box0\hfil}\else \box0 \fi}
\makeatother
\tableofcontents
\endgroup
\cleardoublepage
\ifx \rulang\Undef
\chapter*{Preface SECOND EDITION}
Common Lisp has succeeded. Since publication of the first edition of
this book in 1984, many implementors have used it as a \emph{de facto}
standard for Lisp implementation. As a result, it is now much easier
to port large Lisp programs from one implementation to another.
Common Lisp has proved to be a useful and stable platform for
rapid prototyping and
systems delivery in artificial intelligence and other areas.
With experience gained in using Common Lisp for so many
applications, implementors found no shortage of opportunities for
innovation.
One of the important
characteristics of Lisp is its good support for experimental extension
of the language; while Common Lisp has been stable, it has not stagnated.
\markboth{PREFACE (SECOND EDITION)}{PREFACE (SECOND EDITION)}
The 1984 definition of Common Lisp was imperfect and incomplete.
In some cases this was inadvertent: some odd boundary situation was
overlooked and its consequences not specified, or different
passages were in conflict, or some property of Lisp was so well-known
and traditionally relied upon that I forgot to write it down.
In other cases the informal committee that was defining
Common Lisp could not settle on a solution, and therefore agreed to leave
some important aspect of the language unspecified rather than
choose a less than satisfactory definition. An example
is error handling; 1984 Common Lisp had plenty of ways to signal
errors but no way for a program to trap or process them.
Over the next year I collected reports of errors in the book and gaps in the
language. In December 1985, a group of implementors and users met in
Boston to discuss the state of Common Lisp. I prepared
two lists for this meeting, one of errata and clarifications
that I thought would be relatively uncontroversial (boy, was I wrong!)
and one of more substantial changes I thought should be considered and
perhaps voted upon. Others also brought proposals to discuss.
It became clear to everyone that there was now enough interest in Common Lisp,
and dependence on its stability, that a more formal mechanism was needed for
managing changes to the language.
This realization led to the formation of X3J13, a subcommittee of
ANSI committee X3, to produce a formal American National Standard
for Common Lisp. That process is nearing completion. X3J13 has
completed the bulk of its technical work in rectifying the 1984
definition and codifying extensions to that definition that have
received widespread use and approval. A draft standard is now
being prepared; it will probably be available
in 1990. There will then be a period (required by ANSI) for
public review. X3J13 must then consider the comments it receives
and respond appropriately. If the comments result
in substantial changes to the draft standard, multiple public review
periods may be required before the draft can be approved as an American
National Standard.
Fortunately, X3J13 has done an outstanding job of documenting its work.
For every change that came to a formal vote, a document was prepared
that described the problem to be solved and one or more solutions.
For each solution there is a detailed proposal for changing the
language; a rationale; test cases that distinguish the proposal
from the status quo or from other proposals for solving that problem;
discussions of current practice, cost to implementors, cost to users,
cost of not adopting the proposal, benefits of adoption,
aesthetic criteria; and any relevant informal discussion that may have
preceded creation of the formal proposal. All of these proposal
documents were made available on-line as well as in paper form.
By my count, by June 1989 some
186 such proposals were approved as language changes.
(This count does not include many proposals that came before the committee
but were rejected.)
The purpose of this second edition is to bridge the gap between the
first edition and the forthcoming ANSI standard for Common Lisp.
Because of the requirement for formal public review,
it will be some time yet before the ANSI standard is final.
This book in no way resembles the forthcoming standard (which
is being written independently
by Kathy Chapman of Digital Equipment Corporation with assistance
from the X3J13 Drafting Subcommittee).
I have incorporated into this second edition
a great deal of material based on the votes of X3J13,
in order to give the reader a picture of where the language is heading.
My purpose here is not simply to quote the X3J13 documents verbatim
but to paraphrase them and relate them to the structure of the first
edition. A single vote by X3J13 may be discussed in many parts of this book,
and a single passage of this book may be affected by many of the votes.
I wish to be very clear: this book is not an official document
of X3J13, though it is based on publicly available material
produced by X3J13. In no way does this book constitute a definitive
description of the forthcoming ANSI standard. The
committee's decisions have been remarkably stable (it has rescinded
earlier decisions only two or three times), and I do not
expect radical changes in direction.
Nevertheless, it is quite probable
that the draft standard will be substantively revised in response to
editorial review or public comment.
I have therefore reported here on the actions of X3J13 not to
inscribe them in \strut stone, but to make clear how the language
of the first edition is likely to change.
I have tried to be careful
in my wording to avoid saying ``the language has been changed''
and to state simply that
``X3J13 voted at such-and-so time to make the following change.''
Until the day when an official ANSI Common Lisp standard emerges,
it is likely that the 1984 definition of Common Lisp will
continue to be used widely. This book has been designed
to be used as a reference both to the 1984 definition
and to the language as modified by the actions of X3J13.
It contains the entire text of the first edition
of \emph{Common Lisp: The Language}, with corrections
and minor editorial changes;
however, more than half of the material in this edition is new.
All new material is
identified by solid lines
in the left margin.
Dotted lines in the left margin indicate material from the first edition
that applies to the 1984 definition but that has been modified
by a vote of X3J13. Modifications to these outmoded
passages are explained by preceding or following text (which will
have a solid line in the margin).
In summary:
\begin{itemize}
\item To use the 1984 language definition, read all material that does not
have a solid line in the margin.
\item To use the updated language definition, read everything, but
be wary of material with a dotted line in the margin.
\end{itemize}
At the end of the book is an index of the X3J13 votes, ordered
by the committee's internal code names (included to ease cross-reference
to the X3J13 documents, which may be useful during the public review
periods). References to this list of votes appear as numbers
in angle brackets; thus
``$\langle$14$\rangle$'' refers to the vote on issue number 14, whereas
``[14]'' refers to reference 14 in the bibliography.
I have kept changes to the wording of the first-edition material to a minimum.
Obvious spelling and typographical errors have been corrected,
and the entire text has been edited to a uniform style of
spelling and punctuation. (Note in particular that the first edition
used the spelling ``signalling'' but this edition,
in deference to the style decision of the X3J13 Drafting
Subcommittee, uses ``signaling.'') A few minor
changes were made to accommodate typographical or layout constraints.
(For example, the word ``also'' has been deleted from the first
sentence of chapter~1, partly to make that paragraph look better
and partly to allow a better page break at the bottom of page~2.)
In a very few cases the first edition contained substantive errors
that I could not in good conscience correct silently; these have
been flagged by paragraphs beginning with the phrase
\emph{Notice of correction}.
The chapter and section numbering of this edition matches that
of the first edition, with the exception that a new
section~\ref{STRUCTURE-TRAVERSAL-SECTION}
has been interpolated.
Four new chapters (\ref{LOOP}--\ref{CONDITION})
describe substantial changes approved by X3J13: an extended
\cdf{loop} macro, a pretty printer interface, the Common Lisp
Object System, and the Common Lisp Condition System.
X3J13, in the course of its work, formed a subcommittee to study
whether additional means of iteration
should be standardized for use in Common Lisp, for a great
deal of existing practice in this area was not included in the
first edition because of lack of agreement in~1984.
The X3J13 Iteration Subcommittee produced reports on three possible facilities.
One (\cdf{loop}) was approved for inclusion in the forthcoming draft standard
and is described in chapter~\ref{LOOP}.
X3J13 expressed interest in the other two approaches (series and generators),
but the consensus as of January 1989
was that these other approaches were not yet sufficiently mature or
in sufficiently widespread use to warrant inclusion in the draft Common Lisp
standard at that time. However, the subcommittee was directed to continue work
on these approaches and X3J13 is open to the possibility of standardizing
them at a later date.
Please note that I do not wish the prejudge the
question of whether X3J13 will ever choose to make the other two proposals the
subject of standardization. Nevertheless,
I have chosen to include them in the second edition,
in cooperation with Dr.~Richard~C.~Waters,
as appendices~\ref{SERIES} and~\ref{GENERATORS},
in order to make these ideas
available to the Lisp community. In my judgement these proposals
address an area of language design not otherwise covered by Common Lisp
and are likely to have practical value even if they are never
adopted as part of a formal standard.
Some new material in this book has nothing to do with the work of X3J13.
In many places I have added explanations, clarifications, new examples,
warnings, and tips on writing portable code.
Appendix~\ref{BACKQUOTE-SIMULATOR} contains a piece of code
that may help in understanding the backquote syntax.
This second edition,
unlike the first edition, also includes a few diagrams to pep up the text.
However, there are absolutely no new jokes, and very few outright lies.
\chapter*{Acknowledgments SECOND EDITION}
First and foremost, I must thank the many people in the Lisp
community who have worked so hard to specify, implement, and use
Common Lisp. Some of these have volunteered many hours
of effort as members of ANSI committee X3J13. Others
have made presentations or proposals to X3J13, and yet others
have sent suggestions and corrections to the first edition directly to me.
This book builds on their efforts as well as mine.
\markboth{ACKNOWLEDGMENTS (SECOND EDITION)}{ACKNOWLEDGMENTS (SECOND EDITION)}
An early draft of this book was made available to all members
of X3J13 for their criticism. I have also worked with
the many public documents that have been written during the course
of the committee's work (which is not over yet).
It is my hope that this book is an accurate reflection of the
committee's actions as of October 1989.
Nevertheless, any errors or inconsistencies are my responsibility.
The fact that I have made a draft available to certain persons,
received feedback from them, or thanked them in these
acknowledgments does not necessarily imply that any one of them
or any of the institutions with which they are affiliated endorse this book
or anything of its contents.
Digital Press and I gave permission to X3J13 to use any or all parts
of the first edition in the production of an ANSI Common Lisp standard.
Conversely, in writing this book I have worked with publicly available
documents produced by X3J13 in the course of its work, and in some cases
as a courtesy have obtained the consent of the authors of those documents
to quote them extensively. This common ancestry will result in similarities
between this book and the emerging ANSI Common Lisp standard (that is the
purpose, after all). Nevertheless, this second edition
has no official connection whatsoever
with X3J13 or ANSI, nor is it endorsed by either of those institutions.
The following persons have been members of X3J13 or involved in its
activities at one time or another:
Jim Allard, Dave Andre, Jim Antonisse, William Arbaugh, John
Aspinall, Bob Balzer, Gerald Barber, Richard Barber, Kim Barrett,
David Bartley, Roger Bate, Alan Bawden, Michael Beckerle, Paul
Beiser, Eric Benson, Daniel Bobrow, Mary Boelk, Skona Brittain, Gary
Brown, Tom Bucken, Robert Buckley, Gary Byers, Dan Carnese, Bob
Cassels, J\'er\^ome Chailloux, Kathy Chapman, Thomas Christaller,
Will Clinger, Peter Coffee, John Cugini, Pavel Curtis, Doug Cutting,
Christopher Dabrowski, Jeff Dalton, Linda DeMichiel, Fred Discenzo,
Jerry Duggan, Patrick Dussud, Susan Ennis, Scott Fahlman, Jogn Fitch,
John Foderaro, Richard Gabriel, Steven Gadol, Nick Gall, Oscar
Garcia, Robert Gian\-sira\-cusa, Brad Goldstein, David Gray, Richard
Greenblatt, George Hadden, Steve Haflich, Dave Henderson, Carl
Hewitt, Carl Hoffman, Cheng Hu, Masayuki Ida, Takayasu Ito, Sonya
Keene, James Kempf, Gregory Jennings, Robert Kerns, Gregor Kiczales,
Kerry Kimbrough, Dieter Kolb, Timothy Koschmann, Ed Krall, Fritz
Kunze, Aaron Larson, Joachim Laubsch, Kevin Layer, Michael Levin, Ray
Lim, Thom Linden, David Loeffler, Sandra Loosemore, Barry Margolin,
Larry Masinter, David Matthews, Robert Mathis, John McCarthy, Chris
McConnell, Rob McLachlan, Jay Mendelsohn, Martin Mikelsons, Tracey
Miles, Richard Mlyarnik, David Moon, Jarl Nilsson, Leo Noordhulsen,
Ronald Ohlander, Julian Padget, Jeff Peck, Jan Pedersen, Bob
Pellegrino, Crispin Perdue, Dan Pierson, Kent Pitman, Dexter Pratt,
Christian Quiennec, B. Raghavan, Douglas Rand, Jonathan Rees, Chris
Richardson, Jeff Rininger, Walter van Roggen, Jeffrey Rosenking, Don
Sakahara, William Scherlis, David Slater, James Smith, Alan Snyder,
Angela Sodan, Richard Soley, S. Sridhar, Bill St.\ Clair, Philip
Stanhope, Guy Steele, Herbert Stoyan, Hiroshi Torii, Dave Touretzky,
Paul Tucker, Rick Tucker, Thomas Turba, David Unietis, Mary Van
Deusen, Ellen Waldrum, Richard Waters, Allen Wechsler, Mark Wegman,
Jon~L White, Skef Wholey, Alexis Wieland, Martin Yonke, Bill York,
Taiichi Yuasa, Gail Zacharias, and Jan Zubkoff.
I must express particular gratitude and appreciation to a number
of people for their exceptional efforts:
Larry Masinter, chairman of
the X3J13 Cleanup Subcommittee, developed the standard format for
documenting all proposals to be voted upon. The result has been
an outstanding technical and historical record of all the actions
taken by X3J13 to rectify and improve Common Lisp.
Sandra Loosemore, chairwoman of the X3J13 Compiler Subcommittee,
produced many proposals for clarifying the semantics of the compilation
process. She has been a diligent stickler for detail and has helped
to clarify many parts of Common Lisp left vague in the first edition.
Jon L White, chairman of the X3J13 Iteration Subcommittee,
supervised the consideration of several controversial
proposals, one of which (\cdf{loop}) was eventually adopted by X3J13.
Thom Linden, chairman of the X3J13 Character Subcommittee,
led a team in grappling with the difficult problem of accommodating
various character sets in Common Lisp. One result is that
Common Lisp will be more attractive for international use.
Kent Pitman, chairman of the X3J13 Error Handling Subcommittee,
plugged the biggest outstanding
hole in Common Lisp as described by the first edition.
Kathy Chapman, chairwoman of the X3J13 Drafting Subcommittee,
and principal author of the draft standard, has not only written
a great deal of text but also insisted on coherent and consistent
terminology and pushed the rest of the committee forward when necessary.
Robert Mathis, chairman of X3J13, has kept administrative matters
flowing smoothly during technical controversies.
Mary Van Deusen, secretary of X3J13, kept excellent minutes
that were a tremendous aid to me in tracing the history of
a number of complex discussions.
Jan Zubkoff, X3J13 meeting and mailing
organizer, knows what's going on, as always.
She is a master of organization and of physical arrangements.
Moreover, she once again pulled me out of the fire at the last minute.
Dick Gabriel, international representative for X3J13,
has kept information flowing smoothly between Europe, Japan,
and the United States. He provided a great deal of the energy and drive
for the completion of the Common Lisp Object System specification.
He has also provided me with a great
deal of valuable advice and has been on call for last-minute
consultation at all hours during the final stages of preparation
for this book.
David Moon has consistently been a source of reason,
expert knowledge, and careful scrutiny. He has read the
first edition and the X3J13 proposals perhaps more carefully
than anyone else.
David Moon, Jon~L White, Gregor Kiczales, Robert Mathis, Mary Boelk
provided extensive feedback on an early draft of this book.
I thank them as well as the many others who commented in one way
or another on the draft.
I wish to thank the authors of large proposals to X3J13
that have made material available for more or less wholesale
inclusion in this book as distinct chapters.
This material was produced primarily for the use of X3J13 in its work.
It has been included here
on a non-exclusive basis with the consent of the authors.
The author of the chapter on \cdf{loop} (Jon~L White)
notes that the chapter is based on documentation
written at Lucid, Inc., by Molly~M. Miller,
Sonia Orin Lyris, and Kris Dinkel.
Glenn Burke, Scott Fahlman, Colin Meldrum,
David Moon, Cris Perdue, and Dick Waters
contributed to the design of the \cdf{loop} macro.
The authors of the Common Lisp Object System specification
(Daniel G.~Bobrow, Linda G.~DeMichiel,
Richard P.~Gabriel, Sonya E.~Keene, Gregor Kiczales,
and David A.~Moon)
wish to thank Patrick Dussud, Kenneth Kahn,
Jim Kempf, Larry Masinter, Mark Stefik,
Daniel~L. Weinreb, and Jon~L White
for their contributions.
The author of the chapter on Conditions (Kent M. Pitman)
notes that there is a paper \cite{EXCEPTIONAL-SITUATIONS}
containing background information about the design of the
condition system, which is based on the condition system
of the Symbolics Lisp Machines \cite{SIGNALLING-CONDITIONS}.
The members of the X3J13 Error Handling Subcommittee
were
Andy Daniels and Kent Pitman.
Richard Mlynarik and David~A. Moon made major design contributions.
Useful comments, questions,
suggestions, and criticisms were provided by
Paul Anagnostopoulos,
Alan Bawden,
William Chiles,
Pavel Curtis,
Mary Fontana,
Dick Gabriel,
Dick King,
Susan Lander,
David D. Loeffler,
Ken Olum,
David~C. Plummer,
Alan Snyder,
Eric Weaver, and
Daniel~L. Weinreb.
The Condition System was designed specifically to
accommodate the needs of Common Lisp.
The design is, however, most directly based on the ``New Error System''
(NES) developed at Symbolics by David L. Andre,
Bernard~S. Greenberg,
Mike McMahon,
David~A. Moon, and
Daniel~L. Weinreb.
The NES was in turn based on experiences with the original Lisp
Machine error system (developed at MIT), which was found to be
inadequate for the needs of the modern Lisp Machine environments.
Many aspects of the NES were inspired by the (PL/I) condition
system used by the Honeywell Multics operating system. Henry Lieberman
provided
conceptual guidance and encouragement in the design of the NES.
A reimplementation of the NES for non-Symbolics Lisp Machine
dialects (MIT, LMI, and TI) was done at MIT by Richard~M. Stallman.
During the process
of that reimplementation, some conceptual changes were made which
have significantly influenced the Common Lisp Condition System.
As for the smaller but no less important proposals,
Larry Masinter deserves recognition as an author of over half of them.
He has worked indefatigably to write up proposals and to polish
drafts by other authors. Kent Pitman, David Moon, and Sandra Loosemore
have also been notably prolific,
as well as Jon~L White, Dan Pierson, Walter van Roggen,
Skona Brittain, Scott Fahlman, and myself.
Other authors of proposals include
David Andre,
John Aspinall,
Kim Barrett,
Eric Benson,
Daniel Bobrow,
Bob Cassels,
Kathy Chapman,
William Clinger,
Pavel Curtis,
Doug Cutting,
Jeff Dalton,
Linda DiMichiel,
Richard Gabriel,
Steven Haflich,
Sonya Keene,
James Kempf,
Gregor Kiczales,
Dieter Kolb,
Barry Margolin,
Chris McConnell,
Jeff Peck,
Jan Pedersen,
Crispin Perdue,
Jonathan Rees,
Don Sakahara,
David Touretzky,
Richard Waters, and
Gail Zacharias.
I am grateful to Donald~E. Knuth and his colleagues for producing
the \TeX\ text formatting system \cite{KNUTH-TEXBOOK},
which was used to produce
and typeset the manuscript.
Knuth did an especially good job of publishing the program for
\TeX~\cite{KNUTH-TEX-PROGRAM};
I had to consult the code about eight times while debugging particularly
complicated macros. Thanks to the extensive indexing
and cross-references, in each case it took me less than five minutes to
find the relevant fragment of that 500-page program.
I also owe a debt
to Leslie Lamport, author of the \LaTeX\ macro package~\cite{LAMPORT-LATEX}
for \TeX,
within which I implemented the document style for this book.
Blue Sky Research sells and supports Textures, an implementation
of \TeX\ for Apple Macintosh computers; Gayla Groom and Barry Smith
of Blue Sky Research provided excellent technical support when I
needed it. Other software tools that were invaluable
in preparing this book were QuicKeys (sold by CE Software, Inc.),
which provides keyboard macros;
G\=ofer (sold by Microlytics, Inc.), which performs rapid
text searches in multiple files; Symantec Utilities for Macintosh
(sold by Symantec Corporation), which saved me from more than one disk crash;
and the PostScript language and compatible
fonts (sold by Adobe Systems Incorporated).
Some of this software (such as \LaTeX) I obtained for free and some I bought,
but all have proved to be useful tools of excellent quality.
I am grateful to these developers for creating them.
Electronic mail has been indispensible to
the writing of this book, as well to as the work of X3J13.
(It is a humbling experience to publish a book and then for
the next five years to receive
at least one electronic mail message a week, if not twenty, pointing out
some mistake or defect.)
Kudos to those develop and maintain the Internet, which arose
from the Arpanet and other networks.
Chase Duffy, George Horesta, and Will Buddenhagen of Digital Press have given me
much encouragement and support. David Ford designed the book and
provided specifications that I could code into \TeX.
Alice Cheyer and Kate Schmit edited the copy for style
and puzzled over the more obscure jokes with great patience.
Marilyn Rowland created the index; Tim Evans and I did some polishing.
Laura Fillmore and her colleagues at Editorial, Inc., have
tirelessly and meticulously checked one draft after another and
has kept the paperwork flowing smoothly during the last hectic weeks
of proofreading, page makeup, and typesetting.
Thinking Machines Corporation has supported all my work with X3J13.
I thank all my colleagues there for their encouragement and help.
Others who provided indispensible encouragement and support include
Guy and Nalora Steele; David Steele; Cordon and Ruth Kerns;
David, Patricia, Tavis, Jacob, Nicholas, and Daniel Auwerda;
Donald and Denise Kerns; and David, Joyce, and Christine Kerns.
Most of the writing of this book took place between
10 P.M.~and 3 A.M.~(I'm not as young as I used to be).
I am grateful to Barbara,
Julia, Peter, and Matthew for putting up with it, and for their love.
\begin{tabbing}
Guy L. Steele Jr. \\
Lexington, Massachusetts \\
All Saints' Day, 1989
\end{tabbing}
\chapter*{Acknowledgments FIRST EDITION (1984)}
Common Lisp was designed
by a diverse group of people affiliated with many institutions.
\markboth{ACKNOWLEDGMENTS (FIRST EDITION, 1984)}{ACKNOWLEDGMENTS (FIRST EDITION, 1984)}
Contributors to the
design and implementation of Common Lisp and to the polishing of this book
are hereby gratefully acknowledged:
\vskip 0pt plus 10pt
\hrule width 0pt\relax
\begin{tabbing}
\hskip8.5pc\=\kill
Paul Anagnostopoulos\>Digital Equipment Corporation \\
Dan Aronson\>Carnegie-Mellon University \\
Alan Bawden\>Massachusetts Institute of Technology \\
Eric Benson\>University of Utah, Stanford University, and Symbolics,\\
\>Incorporated \\
Jon Bentley\>Carnegie-Mellon University and Bell
Laboratories \\ Jerry Boetje\>Digital Equipment Corporation \\
Gary Brooks\>Texas Instruments \\
Rodney A. Brooks\>Stanford University \\
Gary L. Brown\>Digital Equipment Corporation \\
Richard L. Bryan\>Symbolics, Incorporated \\
Glenn S. Burke\>Massachusetts Institute of Technology \\
Howard I. Cannon\>Symbolics, Incorporated \\
George J. Carrette\>Massachusetts Institute of Technology \\
Robert Cassels\>Symbolics, Incorporated \\
Monica Cellio\>Carnegie-Mellon University \\
David Dill\>Carnegie-Mellon University \\
Scott E. Fahlman\>Carnegie-Mellon University \\
Richard J. Fateman\>University of California, Berkeley \\
Neal Feinberg\>Carnegie-Mellon University \\
Ron Fischer\>Rutgers University \\
John Foderaro\>University of California, Berkeley \\
Steve Ford\>Texas Instruments
\end{tabbing}
\penalty-10000
\begin{tabbing}
\hskip8.5pc\=\kill
Richard P. Gabriel\>Stanford University and Lawrence Livermore National \\
\>Laboratory \\
Joseph Ginder\>Carnegie-Mellon University and Perq Systems Corp. \\
Bernard S. Greenberg\>Symbolics, Incorporated \\
Richard Greenblatt\>Lisp Machines Incorporated (LMI) \\
Martin L. Griss\>University of Utah and Hewlett-Packard Incorporated \\
Steven Handerson\>Carnegie-Mellon University \\
Charles L. Hedrick\>Rutgers University \\
Gail Kaiser\>Carnegie-Mellon University \\
Earl A. Killian\>Lawrence Livermore National Laboratory \\
Steve Krueger\>Texas Instruments \\
John L. Kulp\>Symbolics, Incorporated \\
Jim Large\>Carnegie-Mellon University \\
Rob Maclachlan\>Carnegie-Mellon University \\
William Maddox\>Carnegie-Mellon University \\
Larry M. Masinter\>Xerox Corporation, Palo Alto Research Center \\
John McCarthy\>Stanford University \\
Michael E. McMahon\>Symbolics, Incorporated \\
Brian Milnes\>Carnegie-Mellon University \\
David A. Moon\>Symbolics, Incorporated \\
Beryl Morrison\>Digital Equipment Corporation \\
Don Morrison\>University of Utah \\
Dan Pierson\>Digital Equipment Corporation \\
Kent M. Pitman\>Massachusetts Institute of Technology \\
Jonathan Rees\>Yale University \\
Walter van Roggen\>Digital Equipment Corporation \\
Susan Rosenbaum\>Texas Instruments \\
William L. Scherlis\>Carnegie-Mellon University \\
Lee Schumacher\>Carnegie-Mellon University \\
Richard M. Stallman\>Massachusetts Institute of Technology \\
Barbara K. Steele\>Carnegie-Mellon University \\
Guy L. Steele Jr.\>Carnegie-Mellon University and Tartan Laboratories \\
\>Incorporated \\
Peter Szolovits\>Massachusetts Institute of Technology \\
William vanMelle\>Xerox Corporation, Palo Alto Research Center \\ Ellen
Waldrum\>Texas Instruments \\ Allan C. Wechsler\>Symbolics, Incorporated \\
Daniel L. Weinreb\>Symbolics, Incorporated \\
Jon L White\>Xerox Corporation, Palo Alto Research Center \\
Skef Wholey\>Carnegie-Mellon University
\end{tabbing}
\begin{tabbing}
\hskip8.5pc\=\kill
Richard Zippel\>Massachusetts Institute of Technology \\
Leonard Zubkoff\>Carnegie-Mellon University and Tartan Laboratories \\
\>Incorporated
\end{tabbing}
Some contributions were relatively small; others involved enormous
expenditures of effort and great dedication. A few of the contributors
served more as worthy adversaries than as benefactors (and do not
necessarily endorse the final design reported here),
but their pointed criticisms were just as important to the polishing of Common Lisp
as all the positively phrased suggestions.
All of the people named above were helpful in one way or another,
and I am grateful for the interest and spirit of cooperation
that allowed most decisions to be made by consensus after due discussion.
Considerable encouragement and moral support were also provided by:
\begin{tabbing}
\hskip1.5in\=\kill
Norma Abel\>Digital Equipment Corporation \\
Roger Bate\>Texas Instruments \\
Harvey Cragon\>Texas Instruments \\
Dennis Duncan\>Digital Equipment Corporation \\
Sam Fuller\>Digital Equipment Corporation \\
A. Nico Habermann\>Carnegie-Mellon University \\
Berthold K. P. Horn\>Massachusetts Institute of Technology \\
Gene Kromer\>Texas Instruments \\
Gene Matthews\>Texas Instruments \\
Allan Newell\>Carnegie-Mellon University \\
Dana Scott\>Carnegie-Mellon University \\
Harry Tennant\>Texas Instruments \\
Patrick H. Winston\>Massachusetts Institute of Technology \\
Lowell Wood\>Lawrence Livermore National Laboratory \\
William A. Wulf\>Carnegie-Mellon University and Tartan Laboratories \\
\>Incorporated
\end{tabbing}
I am very grateful to each of them.
Jan Zubkoff of Carnegie-Mellon University
provided a great deal of organization,
secretarial support, and unfailing good cheer in the face of adversity.
The development of Common Lisp would most probably not have been possible
without the electronic message system provided by the ARPANET.
Design decisions were made on several hundred distinct points, for the
most part by consensus, and by simple majority vote when necessary.
Except for two one-day face-to-face meetings, all of the language design
and discussion was done through the {ARPANET} message system, which
permitted effortless dissemination of messages to dozens of people, and
several interchanges per day. The message system also provided
automatic archiving of the entire discussion, which has proved
invaluable in the preparation of this reference manual. Over the course
of thirty months, approximately 3000 messages were sent (an average of
three per day), ranging in length from one line to twenty pages.
Assuming 5000 characters per printed page of text, the entire
discussion totaled about 1100 pages. It would have been substantially
more difficult to have conducted this discussion by any other means,
and would have required much more time.
The ideas in Common Lisp have come from many sources and been polished by
much discussion. I am responsible for the form of this
book, and for any errors or inconsistencies that may remain;
but the credit for the design and support of Common Lisp lies with
the individuals named above, each of whom has made significant
contributions.
The organization and content
of this book were inspired in large part by the
\emph{MacLISP Reference Manual} by David A. Moon and others \cite{MOONUAL},
and by the \emph{LISP Machine Manual} (fourth edition)
by Daniel Weinreb and David Moon \cite{BLUE-LISPM},
which in turn acknowledges the efforts of Richard Stallman, Mike McMahon,
Alan Bawden, Glenn Burke, and ``many people too numerous to list.''
I thank Phyllis Keenan, Chase Duffy,
Virginia Anderson,
John Osborn,
and Jonathan Baker of Digital Press for their
help in preparing this book for publication.
Jane Blake did an admirable job of copy-editing.
James Gibson and Katherine Downs of Waldman Graphics were most cooperative
in typesetting this book from my on-line manuscript files.
I am grateful to Carnegie-Mellon University and to
Tartan Laboratories Incorporated for supporting me in the writing
of this book over the last three years.
Part of the work on this book was
done in conjunction with the Carnegie-Mellon University Spice Project,
an effort to construct an advanced scientific software development
environment for personal computers.
The Spice Project is
supported by the Defense Advanced Research Projects Agency, Department
of Defense, ARPA Order 3597, monitored by the Air Force Avionics
Laboratory under contract F33615-78-C-1551. The views
and conclusions contained in this book are those of the author
and should not be interpreted as representing the official policies,
either expressed or implied, of the Defense Advanced Research
Projects Agency or the U.S. Government.
Most of the writing of this book took place between
midnight and 5 A.M. I am grateful to Barbara, Julia, and Peter
for putting up with it, and for their love.
\begin{tabbing}
Guy L. Steele Jr. \\
Pittsburgh, Pennsylvania \\
March 1984
\end{tabbing}
% RUSSIAN
\else
\chapter*{Пролог ВТОРОЕ ИЗДАНИЕ}
Common Lisp к успеху пришел. С момента публикации первой редакции
данной книги в 1984, много организаций использовали его как \emph{де-факто}
стандарт для реализации Lisp'а. В результате сейчас гораздо
проще портировать большую Lisp программу с одной реализации на
другую. Common Lisp доказал свою полезность и стабильность, как
платформы для быстрого прототипирования и быстрой поставки систем в
области искусственного интеллекта и не только в ней. С приобретённым
опытом использования Common Lisp'а для такого большого количества
приложений, организации не нашли недостатков в возможностях для
инноваций. Одна из важных характеристик Lisp'а это его хорошая
поддержка для экспериментальных расширений языка; несмотря на то, что
Common Lisp стабилен, он не инертен.
Версия Common Lisp'а от 1984 года была несовершенной и
незавершённой. В некоторых случаях допускались неосторожности:
некоторые двузначные ситуации игнорировались и из следствия не
определялись, или разные вещи конфликтовали или некоторые свойства
Lisp'а были так хорошо известны, что на них традиционно
полагались, даже автор забыл их записать. В других случаях
неофициальный комитет, что создавал Common Lisp, не мог принять
решение и соглашался оставить некоторые важные вещи языка
неопределёнными, чем выбирать менее удачный вариант. Например,
обработка ошибок; в Common Lisp 1984 года было изобилие способов
генерации сигналов об ошибках, но не было методов для их ловушек.
\chapter*{Благодарности ВТОРОЕ ИЗДАНИЕ}
Прежде всего, автор должен поблагодарить большое количество людей в Lisp
сообществе, которые затратили большой труд для разработки, внедрения и
использования Common Lisp. Некоторые из них затратили многие часы
усилий в качестве членов комитета ANSI X3J13. Другие
сделали презентацию или предложения X3J13, а третьи
направили предложения и поправки к первому изданию прямо ко мне.
Эта книга основывается на их и моих усилиях.
\markboth{ACKNOWLEDGMENTS (SECOND EDITION)}{ACKNOWLEDGMENTS (SECOND EDITION)}
An early draft of this book was made available to all members
of X3J13 for their criticism. I have also worked with
the many public documents that have been written during the course
of the committee's work (which is not over yet).
It is my hope that this book is an accurate reflection of the
committee's actions as of October 1989.
Nevertheless, any errors or inconsistencies are my responsibility.
The fact that I have made a draft available to certain persons,
received feedback from them, or thanked them in these
acknowledgments does not necessarily imply that any one of them
or any of the institutions with which they are affiliated endorse this book
or anything of its contents.
Ранний черновик этой книги быть доступен для критики всем членам комитета
X3J13. Также автор проработал много опубликованных документов, которые были написаны
в течение работы комитета (который ещё не закончился).
Автор надеется книги являются наиболее точным отражением работы комитета на октябрь
1989 года.
Тем не менее, все ошибки или неточности лежат на ответственности автора.
Digital Press and I gave permission to X3J13 to use any or all parts
of the first edition in the production of an ANSI Common Lisp standard.
Conversely, in writing this book I have worked with publicly available
documents produced by X3J13 in the course of its work, and in some cases
as a courtesy have obtained the consent of the authors of those documents
to quote them extensively. This common ancestry will result in similarities
between this book and the emerging ANSI Common Lisp standard (that is the
purpose, after all). Nevertheless, this second edition
has no official connection whatsoever
with X3J13 or ANSI, nor is it endorsed by either of those institutions.
Следующие лица были членами X3J13 или участвовали в его
деятельности в тот или иной момент:
Jim Allard, Dave Andre, Jim Antonisse, William Arbaugh, John
Aspinall, Bob Balzer, Gerald Barber, Richard Barber, Kim Barrett,
David Bartley, Roger Bate, Alan Bawden, Michael Beckerle, Paul
Beiser, Eric Benson, Daniel Bobrow, Mary Boelk, Skona Brittain, Gary
Brown, Tom Bucken, Robert Buckley, Gary Byers, Dan Carnese, Bob
Cassels, J\'er\^ome Chailloux, Kathy Chapman, Thomas Christaller,
Will Clinger, Peter Coffee, John Cugini, Pavel Curtis, Doug Cutting,
Christopher Dabrowski, Jeff Dalton, Linda DeMichiel, Fred Discenzo,
Jerry Duggan, Patrick Dussud, Susan Ennis, Scott Fahlman, Jogn Fitch,
John Foderaro, Richard Gabriel, Steven Gadol, Nick Gall, Oscar
Garcia, Robert Gian\-sira\-cusa, Brad Goldstein, David Gray, Richard
Greenblatt, George Hadden, Steve Haflich, Dave Henderson, Carl
Hewitt, Carl Hoffman, Cheng Hu, Masayuki Ida, Takayasu Ito, Sonya
Keene, James Kempf, Gregory Jennings, Robert Kerns, Gregor Kiczales,
Kerry Kimbrough, Dieter Kolb, Timothy Koschmann, Ed Krall, Fritz
Kunze, Aaron Larson, Joachim Laubsch, Kevin Layer, Michael Levin, Ray
Lim, Thom Linden, David Loeffler, Sandra Loosemore, Barry Margolin,
Larry Masinter, David Matthews, Robert Mathis, John McCarthy, Chris
McConnell, Rob McLachlan, Jay Mendelsohn, Martin Mikelsons, Tracey
Miles, Richard Mlyarnik, David Moon, Jarl Nilsson, Leo Noordhulsen,
Ronald Ohlander, Julian Padget, Jeff Peck, Jan Pedersen, Bob
Pellegrino, Crispin Perdue, Dan Pierson, Kent Pitman, Dexter Pratt,
Christian Quiennec, B. Raghavan, Douglas Rand, Jonathan Rees, Chris
Richardson, Jeff Rininger, Walter van Roggen, Jeffrey Rosenking, Don
Sakahara, William Scherlis, David Slater, James Smith, Alan Snyder,
Angela Sodan, Richard Soley, S. Sridhar, Bill St.\ Clair, Philip
Stanhope, Guy Steele, Herbert Stoyan, Hiroshi Torii, Dave Touretzky,
Paul Tucker, Rick Tucker, Thomas Turba, David Unietis, Mary Van
Deusen, Ellen Waldrum, Richard Waters, Allen Wechsler, Mark Wegman,
Jon~L White, Skef Wholey, Alexis Wieland, Martin Yonke, Bill York,
Taiichi Yuasa, Gail Zacharias, and Jan Zubkoff.
Автор должен выразить особую благодарность и признательность ряду
людей за их выдающиеся усилия:
Larry Masinter, chairman of
the X3J13 Cleanup Subcommittee, developed the standard format for
documenting all proposals to be voted upon. The result has been
an outstanding technical and historical record of all the actions
taken by X3J13 to rectify and improve Common Lisp.
Sandra Loosemore, chairwoman of the X3J13 Compiler Subcommittee,
produced many proposals for clarifying the semantics of the compilation
process. She has been a diligent stickler for detail and has helped
to clarify many parts of Common Lisp left vague in the first edition.
Jon L White, chairman of the X3J13 Iteration Subcommittee,
supervised the consideration of several controversial
proposals, one of which (\cdf{loop}) was eventually adopted by X3J13.
Thom Linden, chairman of the X3J13 Character Subcommittee,
led a team in grappling with the difficult problem of accommodating
various character sets in Common Lisp. One result is that
Common Lisp will be more attractive for international use.
Kent Pitman, chairman of the X3J13 Error Handling Subcommittee,
plugged the biggest outstanding
hole in Common Lisp as described by the first edition.
Kathy Chapman, chairwoman of the X3J13 Drafting Subcommittee,
and principal author of the draft standard, has not only written
a great deal of text but also insisted on coherent and consistent
terminology and pushed the rest of the committee forward when necessary.
Robert Mathis, chairman of X3J13, has kept administrative matters
flowing smoothly during technical controversies.
Mary Van Deusen, secretary of X3J13, kept excellent minutes
that were a tremendous aid to me in tracing the history of
a number of complex discussions.
Jan Zubkoff, X3J13 meeting and mailing
organizer, knows what's going on, as always.
She is a master of organization and of physical arrangements.
Moreover, she once again pulled me out of the fire at the last minute.
Dick Gabriel, international representative for X3J13,
has kept information flowing smoothly between Europe, Japan,
and the United States. He provided a great deal of the energy and drive
for the completion of the Common Lisp Object System specification.
He has also provided me with a great
deal of valuable advice and has been on call for last-minute
consultation at all hours during the final stages of preparation
for this book.
David Moon has consistently been a source of reason,
expert knowledge, and careful scrutiny. He has read the
first edition and the X3J13 proposals perhaps more carefully
than anyone else.
David Moon, Jon~L White, Gregor Kiczales, Robert Mathis, Mary Boelk
provided extensive feedback on an early draft of this book.
I thank them as well as the many others who commented in one way
or another on the draft.
I wish to thank the authors of large proposals to X3J13
that have made material available for more or less wholesale
inclusion in this book as distinct chapters.
This material was produced primarily for the use of X3J13 in its work.
It has been included here
on a non-exclusive basis with the consent of the authors.
The author of the chapter on \cdf{loop} (Jon~L White)
notes that the chapter is based on documentation
written at Lucid, Inc., by Molly~M. Miller,
Sonia Orin Lyris, and Kris Dinkel.
Glenn Burke, Scott Fahlman, Colin Meldrum,
David Moon, Cris Perdue, and Dick Waters
contributed to the design of the \cdf{loop} macro.
The authors of the Common Lisp Object System specification
(Daniel G.~Bobrow, Linda G.~DeMichiel,
Richard P.~Gabriel, Sonya E.~Keene, Gregor Kiczales,
and David A.~Moon)
wish to thank Patrick Dussud, Kenneth Kahn,
Jim Kempf, Larry Masinter, Mark Stefik,
Daniel~L. Weinreb, and Jon~L White
for their contributions.
The author of the chapter on Conditions (Kent M. Pitman)
notes that there is a paper \cite{EXCEPTIONAL-SITUATIONS}
containing background information about the design of the
condition system, which is based on the condition system
of the Symbolics Lisp Machines \cite{SIGNALLING-CONDITIONS}.
The members of the X3J13 Error Handling Subcommittee
were
Andy Daniels and Kent Pitman.
Richard Mlynarik and David~A. Moon made major design contributions.
Useful comments, questions,
suggestions, and criticisms were provided by
Paul Anagnostopoulos,
Alan Bawden,
William Chiles,
Pavel Curtis,
Mary Fontana,
Dick Gabriel,
Dick King,
Susan Lander,
David D. Loeffler,
Ken Olum,
David~C. Plummer,
Alan Snyder,
Eric Weaver, and
Daniel~L. Weinreb.
The Condition System was designed specifically to
accommodate the needs of Common Lisp.
The design is, however, most directly based on the ``New Error System''
(NES) developed at Symbolics by David L. Andre,
Bernard~S. Greenberg,
Mike McMahon,
David~A. Moon, and
Daniel~L. Weinreb.
The NES was in turn based on experiences with the original Lisp
Machine error system (developed at MIT), which was found to be
inadequate for the needs of the modern Lisp Machine environments.
Many aspects of the NES were inspired by the (PL/I) condition
system used by the Honeywell Multics operating system. Henry Lieberman
provided
conceptual guidance and encouragement in the design of the NES.
A reimplementation of the NES for non-Symbolics Lisp Machine
dialects (MIT, LMI, and TI) was done at MIT by Richard~M. Stallman.
During the process
of that reimplementation, some conceptual changes were made which
have significantly influenced the Common Lisp Condition System.
As for the smaller but no less important proposals,
Larry Masinter deserves recognition as an author of over half of them.
He has worked indefatigably to write up proposals and to polish
drafts by other authors. Kent Pitman, David Moon, and Sandra Loosemore
have also been notably prolific,
as well as Jon~L White, Dan Pierson, Walter van Roggen,
Skona Brittain, Scott Fahlman, and myself.
Other authors of proposals include
David Andre,
John Aspinall,
Kim Barrett,
Eric Benson,
Daniel Bobrow,
Bob Cassels,
Kathy Chapman,
William Clinger,
Pavel Curtis,
Doug Cutting,
Jeff Dalton,
Linda DiMichiel,
Richard Gabriel,
Steven Haflich,
Sonya Keene,
James Kempf,
Gregor Kiczales,
Dieter Kolb,
Barry Margolin,
Chris McConnell,
Jeff Peck,