Implementation Notes for GNU CLISP

These notes document CLISP version 2.41

Bruno Haible

Michael Stoll

Sam Steingold

See COPYRIGHT for the list of other contributors.

Legal Status of the CLISP Implementation Notes

Abstract

These notes describe the GNU CLISP - an implementation of the [ANSI CL].

See the section called “Bugs” for instructions on how to report bugs (both in these notes and in CLISP itself).

See Q: A.1.1.4 for information on CLISP support.


Table of Contents

Overview
Conventions
I. Chapters or the Common Lisp HyperSpec
1. Introduction [CLHS-1]
1.1. Special Symbols [CLHS-1.4.1.3]
1.2. Error Terminology [CLHS-1.4.2]
1.3. Symbols in the Package COMMON-LISP [CLHS-1.9]
2. Syntax [CLHS-2]
2.1. Standard Characters [CLHS-2.1.3]
2.2. Reader Algorithm [CLHS-2.2]
2.3. Symbols as Tokens [CLHS-2.3.4]
2.4. Valid Patterns for Tokens [CLHS-2.3.5]
2.5. Backquote [CLHS-2.4.6]
2.6. Sharpsign [CLHS-2.4.8]
3. Evaluation and Compilation [CLHS-3]
3.1. Evaluation [CLHS-3.1]
3.2. Compilation [CLHS-3.2]
3.3. Declarations [CLHS-3.3]
3.4. Lambda Lists [CLHS-3.4]
3.5. The Evaluation and Compilation Dictionary [CLHS-3.8]
4. Types and Classes [CLHS-4]
4.1. Types [CLHS-4.2]
4.2. Classes [CLHS-4.3]
4.3. Deviations from ANSI CL standard
4.4. Standard Metaclasses [CLHS-4.3.1.1]
4.5. Defining Classes [CLHS-4.3.2]
4.6. Redefining Classes [CLHS-4.3.6]
4.7. The Types and Classes Dictionary [CLHS-4.4]
5. Data and Control Flow [CLHS-5]
5.1. The Data and Control Flow Dictionary [CLHS-5.3]
6. Iteration [CLHS-6]
6.1. The LOOP Facility [CLHS-6.1]
6.2. The Iteration Dictionary [CLHS-6.2]
7. Objects [CLHS-7]
7.1. Standard Method Combination [CLHS-7.6.6.2]
8. Structures [CLHS-8]
9. Conditions [CLHS-9]
9.1. Embedded Newlines in Condition Reports [CLHS-9.1.3.1.3]
9.2. The Conditions Dictionary [CLHS-9.2]
10. Symbols [CLHS-10]
11. Packages [CLHS-11]
11.1. Constraints on the COMMON-LISP Package for Conforming Programs - package locking [CLHS-11.1.2.1.2]
11.2. The COMMON-LISP-USER Package [CLHS-11.1.2.2]
11.3. Implementation-Defined Packages [CLHS-11.1.2.4]
11.4. Package Case-Sensitivity
11.5. The Packages Dictionary [CLHS-11.2]
12. Numbers [CLHS-12]
12.1. Numeric Types
12.2. Number Concepts [CLHS-12.1]
12.3. The Numbers Dictionary [CLHS-12.2]
13. Characters [CLHS-13]
13.1. Character Scripts [CLHS-13.1.2.1]
13.2. Character Attributes [CLHS-13.1.3]
13.3. Graphic Characters [CLHS-13.1.4.1]
13.4. Alphabetic Characters [CLHS-13.1.4.2]
13.5. Characters With Case [CLHS-13.1.4.3]
13.6. Numeric Characters [CLHS-13.1.4.4]
13.7. Ordering of Characters [CLHS-13.1.6]
13.8. Treatment of Newline during Input and Output [CLHS-13.1.8]
13.9. Character Encodings [CLHS-13.1.9]
13.10. Documentation of Implementation-Defined Scripts [CLHS-13.1.10]
13.11. The Characters Dictionary [CLHS-13.2]
13.12. Platform-Dependent Characters
13.13. Obsolete Constants
14. Conses [CLHS-14]
14.1. The Conses Dictionary [CLHS-14.2]
15. Arrays [CLHS-15]
15.1. Array Elements [CLHS-15.1.1]
15.2. The Arrays Dictionary [CLHS-15.2]
16. Strings [CLHS-16]
16.1. The Strings Dictionary [CLHS-16.2]
17. Sequences [CLHS-17]
17.1. The Sequences Dictionary [CLHS-17.3]
18. Hash Tables [CLHS-18]
18.1. The Hash Tables Dictionary [CLHS-18.2]
19. Filenames [CLHS-19]
19.1. Pathname Components [CLHS-19.2.1]
19.2. :UNSPECIFIC as a Component Value [CLHS-19.2.2.2.3]
19.3. External notation
19.4. Logical Pathnames [CLHS-19.3]
19.5. The Filenames Dictionary [CLHS-19.4]
20. Files [CLHS-20]
20.1. The Files Dictionary [CLHS-20.2]
21. Streams [CLHS-21]
21.1. Interactive Streams [CLHS-21.1.1.1.3]
21.2. Terminal interaction
21.3. The Streams Dictionary [CLHS-21.2]
22. Printer [CLHS-22]
22.1. Multiple Possible Textual Representations [CLHS-22.1.1.1]
22.2. Printing Characters [CLHS-22.1.3.2]
22.3. Package Prefixes for Symbols [CLHS-22.1.3.3.1]
22.4. Printing Other Vectors [CLHS-22.1.3.7]
22.5. Printing Other Arrays [CLHS-22.1.3.8]
22.6. The Lisp Pretty Printer [CLHS-22.2]
22.7. Formatted Output [CLHS-22.3]
22.8. The Printer Dictionary [CLHS-22.4]
23. Reader [CLHS-23]
23.1. Effect of Readtable Case on the Lisp Reader [CLHS-23.1.2]
23.2. The recursive-p argument [CLHS-23.1.3.2]
24. System Construction [CLHS-24]
24.1. The System Construction Dictionary [CLHS-24.2]
25. Environment [CLHS-25]
25.1. Debugging Utilities [CLHS-25.1.2]
25.2. The Environment Dictionary [CLHS-25.2]
26. Glossary [CLHS-26]
27. Appendix [CLHS-a]
28. X3J13 Issue Index [CLHS-ic]
II. Extensions
29. Standard Widely Portable Extensions
29.1. Meta-Object Protocol
29.2. Gray streams
30. Platform Independent Extensions
30.1. Customizing CLISP Process Initialization and Termination
30.2. Saving an Image
30.3. Quitting CLISP
30.4. Internationalization of CLISP
30.5. Encodings
30.6. Generic streams
30.7. Weak Objects
30.8. Finalization
30.9. The Prompt
30.10. Maximum ANSI CL compliance
30.11. Additional Fancy Macros and Functions
30.12. Customizing CLISP behavior
30.13. Code Walker
31. Platform Specific Extensions
31.1. Random Screen Access
31.2. External Modules
31.3. The Foreign Function Call Facility
31.4. The Amiga Foreign Function Call Facility
31.5. Socket Streams
31.6. Quickstarting delivery with CLISP
31.7. Shell, Pipes and Printing
31.8. Operating System Environment
32. Extensions Implemented as Modules
32.1. Matlab Interface
32.2. Netica Interface
32.3. Directory Access
32.4. Berkeley DB access
32.5. POSIX Regular Expressions
32.6. Computer Algebra System PARI
32.7. Perl Compatible Regular Expressions
32.8. PostgreSQL Database Access
32.9. Internationalization of User Programs
32.10. Advanced Readline and History Functionality
32.11. System Calls
32.12. Oracle Interface
32.13. The FastCGI Interface
32.14. Raw Socket Access
32.15. The Wildcard Module
32.16. ZLIB Interface
32.17. LibSVM Interface
III. Internals of the CLISP Implementation
33. The source files of CLISP
33.1. File Types
33.2. Source Pre-Processing
33.3. Files
34. Overview of CLISP's Garbage Collection
34.1. Introduction
34.2. Lisp objects in CLISP
34.3. Object Pointer Representations
34.4. Memory Models
34.5. The burden of garbage-collection upon the rest of CLISP
34.6. Foreign Pointers
35. Extending CLISP
35.1. Adding a built-in function
35.2. Adding a built-in variable
35.3. Recompilation
36. The CLISP bytecode specification
36.1. Introduction
36.2. The virtual machine
36.3. The structure of compiled functions
36.4. The general structure of the instructions
36.5. The instruction set
36.6. Bytecode Design
IV. Appendices
A. Frequently Asked Questions (With Answers) about CLISP
B. GNU Free Documentation License
B.1. PREAMBLE
B.2. APPLICABILITY AND DEFINITIONS
B.3. VERBATIM COPYING
B.4. COPYING IN QUANTITY
B.5. MODIFICATIONS
B.6. COMBINING DOCUMENTS
B.7. COLLECTIONS OF DOCUMENTS
B.8. AGGREGATION WITH INDEPENDENT WORKS
B.9. TRANSLATION
B.10. TERMINATION
B.11. FUTURE REVISIONS OF THIS LICENSE
B.12. ADDENDUM: How to use this License for your documents
C. GNU General Public License
C.1. Preamble
C.2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
C.3. How to Apply These Terms to Your New Programs
Index
References

List of Figures

29.1. Inheritance structure of metaobject classes
29.2. Inheritance structure of class metaobject classes
29.3. Inheritance structure of slot definition metaobject classes
29.4. Inheritance structure of generic function metaobject classes
29.5. Inheritance structure of method metaobject classes
29.6. Inheritance structure of specializer metaobject classes
29.7. Inheritance structure of method combination metaobject classes

List of Tables

5.1. Function call limits
12.1. Boolean operations
12.2. Fixnum limits
13.1. Standard characters
13.2. Semi-standard characters
13.3. Additional Named Characters
13.4. Additional syntax for characters with code from #x00 to #x1F:
13.5. Number of characters
13.6. Additional characters (Win32 platform only.)
13.7. Additional characters (UNIX platform only.)
13.8. Character bit constants (obsolete)
15.1. Array limits
19.1. The minimum filename syntax that may be used portably
25.1. Commands common to the main loop, the debugger and the stepper
25.2. Commands common to the debugger and the stepper
25.3. Commands common to the debugger and the stepper
25.4. Commands specific to EVAL/APPLY
25.5. Commands specific to the debugger
25.6. Commands specific to the stepper
25.7. Time granularity
29.1. Direct Superclass Relationships Among The Specified Metaobject Classes
29.2. Initialization arguments and accessors for class metaobjects
29.3. Initialization arguments and accessors for slot definition metaobjects
29.4. Initialization arguments and accessors for generic function metaobjects
29.5. Initialization arguments and accessors for method metaobjects
29.6. The correspondence between slot access function and underlying slot access generic function
34.1. Memory models with TYPECODES
34.2. Memory models with HEAPCODES

List of Examples

29.1. Example of EXT:FILL-STREAM usage
31.1. Simple declarations and access
31.2. external C variable and some accesses
31.3. Calling an external function
31.4. Another example for calling an external function
31.5. Accessing cpp macros
31.6. Calling Lisp from C
31.7. Calling Lisp from C dynamically
31.8. Variable size arguments: calling gethostname from CLISP
31.9. Accessing variables in shared libraries
31.10. Controlling validity of resources
31.11. Float point array computations
31.12. Using a predefined library function file
31.13. Using flibcall
31.14. Be fully dynamic, defining library bases ourselves
31.15. Some sample function definitions
31.16. Lisp read-eval-print loop server
31.17. Lisp HTTP client
32.1. REGEXP:MATCH
32.2. REGEXP:REGEXP-QUOTE

These notes document CLISP version 2.41Last modified: 2006-10-13