CMU Common Lisp User's Manual

CMU Common Lisp User's Manual

CMU Common Lisp Users Manual Rob ert A MacLachlan Editor July CMUCS Scho ol of Computer Science Carnegie Mellon University Pittsburgh PA Sup ersedes Technical Rep orts CMUCS and CMUCS Abstract CMU Common Lisp is an implementation of that Common Lisp is currently supp orted on MIPSpro cessor DECstations Sparcbased workstations from Sun and the IBM RT PC and other p orts are planned All architectures are supp orted under MachaBerkeley Unix binary compatible op erating system The Sparc is also supp orted under SunOS The largest single part of this do cument describ es the Python compiler and the programming styles and techniques that the compiler encourages The rest of the do cument describ es extensions and the implementation dep endentchoices made in developing this implementation of Common Lisp Wehave added several extensions including a source level debugger an interface to Unix system calls a foreign function call interface supp ort for interpro cess communication and remote pro cedure call and other features that provide agoodenvironment for developing Lisp co de This research was sp onsored by The Defense Advanced Research Pro jects Agency Information Science and Technology Oce under the title Research on Parallel Computing ARPA Order No issued byDARPACMO under Contract MDAC The views and conclusions contained in this do cument are those of the author and should not b e interpreted as represen ting the ocial p olicies either expressed or implied of the US government Keywords lisp Common Lisp manual compiler programming language implementation programming environment Contents Introduction Supp ort Lo cal Distribution of CMU Common Lisp Net Distribution of CMU Common Lisp Source Availability Command Line Options Credits Design Choices and Extensions Data Typ es Symb ols Integers Floats Characters Array Initialization Default Interrupts for Lisp Packages The Editor Garbage Collection Describ e The Insp ector The Graphical Interface The TTY Insp ector Load The Reader Running Programs from Lisp Pro cess Accessors Saving a Core Image Pathnames Unix Pathnames Wildcard Pathnames Logical Pathnames Search Lists Predened SearchLists SearchList Op erations Search List Example Filesystem Op erations Wildcard Matching File Name Completion Miscellaneous Filesystem Op erations Time Parsing and Formatting Lisp Library i CONTENTS ii The Debugger Debugger Intro duction The Command Lo op StackFrames Stack Motion How Arguments are Printed Function Names FunnyFrames Debug Tail Recursion Unknown Lo cations and Interrupts Variable Access Variable Value Availability Note On Lexical Variable Access Source Lo cation Printing How the Source is Found Source Lo cation Availability Compiler Policy Control Exiting Commands Information Commands Breakp oint Commands Breakp oint Example Function Tracing Encapsulation Functions Sp ecials The Compiler Compiler Intro duction Calling the Compiler Compilation Units Undened Warnings Interpreting Error Messages The Parts of the Error Message The Original and Actual Source The Pro cessing Path Error Severity Errors During Macro expansion Read Errors Error Message Parameterization Typ es in Python Compile Time Typ e Errors Precise Typ e Checking Weakened Typ e Checking Getting Existing Programs to Run Compiler Policy The Optimize Declaration The OptimizeInterface Declaration Op en Co ding and Inline Expansion Advanced Compiler Use and Eciency Hints Advanced Compiler Intro duction Typ es Optimization Function Call Represen tation of Ob jects Writing Ecient Code More Ab out Typ es in Python CONTENTS iii More Typ es Meaningful Canonicalization Member Typ es Union Typ es The EmptyTyp e Function Typ es The Values Declaration Structure Typ es The FreezeT yp e Declaration Typ e Restrictions Typ e Style Recommendations Typ e Inference Variable Typ e Inference Lo cal Function Typ e Inference Global Function Typ e Inference Op eration Sp ecic Typ e Inference Dynamic Typ e Inference Typ e Check Optimization Source Optimization Let Optimization ConstantFolding Unused Expression Elimination Control Optimization Unreachable Co de Deletion Multiple Values Optimization Source to Source Transformation Style Recommendations Tail Recursion Tail Recursion Exceptions Lo cal Call SelfRecursive Calls Let Calls Closures Lo cal Tail Recursion Return Values Blo ck Compilation Blo ck Compilation Semantics Blo ck Compilation Declarations Compiler Arguments Practical Diculties Context Declarations Context Declaration Example Inline Expansion Inline Expansion Recording SemiInline Expansion The Mayb eInline Declaration Byte Co ded Compilation Ob ject Represen tation Think Before You Use a List Structure Representation Arrays Vectors BitVectors Hashtables Numb ers CONTENTS iv Descriptors NonDescriptor Representations Variables Generic Arithmetic Fixnums Word Integers Floating Point Eciency Sp ecialized Arrays Sp ecialized Structure Slots Interactions With Lo cal Call Represen tation of Characters General Eciency Hints Compile Your Co de Avoid Unnecessary Consing Complex ArgumentSyntax Mapping and Iteration Trace Files and Disassembly Eciency Notes Typ e Uncertainty Eciency Notes and Typ e Checking Represen tation Eciency Notes Verb osityControl Proling Prole Interface Proling Techniques Nested or Recursive Calls Clock resolution Proling overhead Additional Timing Utilities A Note on Timing Benchmarking Techniques UNIX Interface Reading the Command Line Useful Variables Lisp Equivalents for C Routines Typ e Translations System Area Pointers Unix System Calls File Descriptor Streams Making Sense of Mach Return Co des Unix Interrupts Changing Interrupt Handlers Examples of Signal Handlers Event Dispatching with SERVEEVENT Ob ject Sets The SERVEEVENT Function Using SERVEEVENT with Unix File Descriptors .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    152 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us