SBCL User Manual SBCL Version 1.4.5 2018-02 This Manual Is Part of the SBCL Software System
Total Page:16
File Type:pdf, Size:1020Kb
SBCL User Manual SBCL version 1.4.5 2018-02 This manual is part of the SBCL software system. See the README file for more infor- mation. This manual is largely derived from the manual for the CMUCL system, which was produced at Carnegie Mellon University and later released into the public domain. This manual is in the public domain and is provided with absolutely no warranty. See the COPYING and CREDITS files for more information. i Table of Contents 1 Getting Support and Reporting Bugs :::::::::::::::::::::::::: 1 1.1 Volunteer Support :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Commercial Support :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.3 Reporting Bugs ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.3.1 How to Report Bugs Effectively :::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.3.2 Signal Related Bugs:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2 Introduction :::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.1 ANSI Conformance ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.2 Extensions:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.3 Idiosyncrasies ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.3.1 Declarations ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.3.2 FASL Format :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.3.3 Compiler-only Implementation ::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2.3.4 Defining Constants::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2.3.5 Style Warnings::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2.4 Development Tools:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.4.1 Editor Integration:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.4.2 Language Reference :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.4.3 Generating Executables :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.5 More SBCL Information :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.5.1 SBCL Homepage::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.5.2 Online Documentation ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6 2.5.3 Additional Documentation Files :::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.5.4 Internals Documentation ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.6 More Common Lisp Information :::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.6.1 Internet Community ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.6.2 Third-party Libraries :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.6.3 Common Lisp Books ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.7 History and Implementation of SBCL ::::::::::::::::::::::::::::::::::::::::::::::::: 8 3 Starting and Stopping :::::::::::::::::::::::::::::::::::::::::: 10 3.1 Starting SBCL::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.1.1 From Shell to Lisp :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.1.2 Running from Emacs ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.1.3 Shebang Scripts::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.2 Stopping SBCL :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.2.1 Exit :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 10 3.2.2 End of File ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 3.2.3 Saving a Core Image :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 3.2.4 Exit on Errors :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 3.3 Command Line Options:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 3.3.1 Runtime Options ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 3.3.2 Toplevel Options:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 14 3.4 Initialization Files ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 15 3.5 Initialization and Exit Hooks :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 16 ii 4 Compiler ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 4.1 Diagnostic Messages ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 4.1.1 Controlling Verbosity ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 4.1.2 Diagnostic Severity ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 18 4.1.3 Understanding Compile Diagnostics ::::::::::::::::::::::::::::::::::::::::::::: 18 4.1.3.1 The Parts of a Compiler Diagnostic :::::::::::::::::::::::::::::::::::::::: 18 4.1.3.2 The Original and Actual Source :::::::::::::::::::::::::::::::::::::::::::: 20 4.1.3.3 The Processing Path ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 20 4.2 Handling of Types ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 4.2.1 Declarations as Assertions :::::::::::::::::::::::::::::::::::::::::::::::::::::: 21 4.2.2 Precise Type Checking :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 22 4.2.3 Getting Existing Programs to Run :::::::::::::::::::::::::::::::::::::::::::::: 22 4.2.4 Implementation Limitations ::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 4.3 Compiler Policy ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 4.4 Compiler Errors ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 26 4.4.1 Type Errors at Compile Time ::::::::::::::::::::::::::::::::::::::::::::::::::: 26 4.4.2 Errors During Macroexpansion :::::::::::::::::::::::::::::::::::::::::::::::::: 27 4.4.3 Read Errors :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 27 4.5 Open Coding and Inline Expansion :::::::::::::::::::::::::::::::::::::::::::::::::: 27 4.6 Interpreter::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 28 5 Debugger :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 5.1 Debugger Entry ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 5.1.1 Debugger Banner ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 5.1.2 Debugger Invocation :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 29 5.2 Debugger Command Loop ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 5.3 Stack Frames :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 5.3.1 Stack Motion ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 30 5.3.2 How Arguments are Printed::::::::::::::::::::::::::::::::::::::::::::::::::::: 31 5.3.3 Function Names :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 31 5.3.3.1 Entry Point Details :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 32 5.3.4 Debug Tail Recursion ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 32 5.3.5 Unknown Locations and Interrupts :::::::::::::::::::::::::::::::::::::::::::::: 32 5.4 Variable Access :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 33 5.4.1 Variable Value Availability :::::::::::::::::::::::::::::::::::::::::::::::::::::: 33 5.4.2 Note On Lexical Variable Access :::::::::::::::::::::::::::::::::::::::::::::::: 34 5.5 Source Location Printing :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 34 5.5.1 How the Source is Found:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 35 5.5.2 Source Location Availability :::::::::::::::::::::::::::::::::::::::::::::::::::: 36 5.6 Debugger Policy Control ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 36 5.7 Exiting Commands :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 5.8 Information Commands :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 38 5.9 Function Tracing :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 38 5.10 Single Stepping ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 5.11 Enabling and Disabling the Debugger ::::::::::::::::::::::::::::::::::::::::::::::: 40 6 Efficiency :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 6.1 Slot access::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 6.1.1 Structure object slot access ::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 6.1.2 Standard object slot access:::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 6.2 Dynamic-extent allocation ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 41 6.3 Modular arithmetic :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 43 iii 6.4 Global and Always-Bound variables :::::::::::::::::::::::::::::::::::::::::::::::::: 44 6.5 Miscellaneous Efficiency Issues ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 44 7 Beyond the ANSI Standard :::::::::::::::::::::::::::::::::::: 46 7.1 Reader Extensions ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 7.2 Package-Local Nicknames :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 7.3 Package Variance :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 47 7.4 Garbage Collection :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 48 7.4.1 Finalization::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 48 7.4.2 Weak