CMUCL User's Manual

Total Page:16

File Type:pdf, Size:1020Kb

CMUCL User's Manual CMUCL User’s Manual Robert A. MacLachlan, Editor October 2010 20b CMUCL is a free, high-performance implementation of the Common Lisp programming lan- guage, which runs on most major Unix platforms. It mainly conforms to the ANSI Common Lisp Standard. CMUCL features a sophisticated native-code compiler, a foreign function interface, a graphical source-level debugger, an interface to the X11 Window System, and an Emacs-like edi- tor. Keywords: lisp, Common Lisp, manual, compiler, programming language implementation, pro- gramming environment This manual is based on CMU Technical Report CMU-CS-92-161, edited by Robert A. MacLachlan, dated July 1992. Contents 1 Introduction 1 1.1 Distribution and Support . 1 1.2 Command Line Options . 2 1.3 Credits . 3 2 Design Choices and Extensions 6 2.1 Data Types . 6 2.1.1 Integers . 6 2.1.2 Floats . 6 2.1.3 Extended Floats . 9 2.1.4 Characters . 10 2.1.5 Array Initialization . 10 2.1.6 Hash tables . 10 2.2 Default Interrupts for Lisp . 11 2.3 Implementation-Specific Packages . 12 2.4 Hierarchical Packages . 13 2.4.1 Introduction . 13 2.4.2 Relative Package Names . 13 2.4.3 Compatibility with ANSI Common Lisp . 14 2.5 Package Locks . 15 2.5.1 Rationale . 15 2.5.2 Disabling package locks . 16 2.6 The Editor . 16 2.7 Garbage Collection . 16 2.7.1 GC Parameters . 17 2.7.2 Generational GC . 18 2.7.3 Weak Pointers . 19 2.7.4 Finalization . 19 2.8 Describe . 19 2.9 The Inspector . 20 2.9.1 The Graphical Interface . 20 2.9.2 The TTY Inspector . 20 2.10 Load . 21 2.11 The Reader . 21 2.11.1 Reader Extensions . 21 2.11.2 Reader Parameters . 22 2.12 Stream Extensions . 22 2.13 Simple Streams . 22 2.14 Running Programs from Lisp . 22 2.14.1 Process Accessors . 24 2.15 Saving a Core Image . 25 2.16 Pathnames . 26 2.16.1 Unix Pathnames . 26 2.16.2 Wildcard Pathnames . 27 i CONTENTS ii 2.16.3 Logical Pathnames . 27 2.16.4 Search Lists . 27 2.16.5 Predefined Search-Lists . 28 2.16.6 Search-List Operations . 28 2.16.7 Search List Example . 29 2.17 Filesystem Operations . 29 2.17.1 Wildcard Matching . 29 2.17.2 File Name Completion . 30 2.17.3 Miscellaneous Filesystem Operations . 30 2.18 Time Parsing and Formatting . 30 2.19 Random Number Generation . 32 2.19.1 MT-19937 Generator . 32 2.20 Lisp Threads . 32 2.21 Lisp Library . 32 2.22 Generalized Function Names . 32 2.23 CLOS . 33 2.23.1 Primary Method Errors . 33 2.23.2 Slot Type Checking . 33 2.23.3 Slot Access Optimization . 34 2.23.4 Inlining Methods in Effective Methods . 36 2.23.5 Effective Method Precomputation . 36 2.23.6 Sealing . 37 2.23.7 Method Tracing and Profiling . 37 2.23.8 Misc . 38 2.24 Differences from ANSI Common Lisp . 38 2.24.1 Extensions . 38 2.25 Function Wrappers . 38 2.26 Dynamic-Extent Declarations . 40 2.26.1 &rest argument lists . 40 2.26.2 Closures . 40 2.26.3 list, list*, and cons .......................................... 41 2.27 Modular Arithmetic . 41 2.28 Extension to REQUIRE . 41 2.29 Localization . 42 2.29.1 Dictionary . ..
Recommended publications
  • Speech Understanding Systems: Summary of Results of the Five-Year Research Effort at Carnegie-Mellon University
    Carnegie Mellon University Research Showcase Computer Science Department School of Computer Science 1-1-1977 Speech understanding systems: summary of results of the five-year research effort at Carnegie-Mellon University. Carnegie-Mellon University.Computer Science Dept. Carnegie Mellon University Follow this and additional works at: http://repository.cmu.edu/compsci Recommended Citation Carnegie-Mellon University.Computer Science Dept., "Speech understanding systems: summary of results of the five-year research effort at Carnegie-Mellon University." (1977). Computer Science Department. Paper 1529. http://repository.cmu.edu/compsci/1529 This Technical Report is brought to you for free and open access by the School of Computer Science at Research Showcase. It has been accepted for inclusion in Computer Science Department by an authorized administrator of Research Showcase. For more information, please contact research- [email protected]. NOTICE WARNING CONCERNING COPYRIGHT RESTRICTIONS: The copyright law of the United States (title 17, U.S. Code) governs the making of photocopies or other reproductions of copyrighted material. Any copying of this document without permission of its author may be prohibited by law. "7? • 3 SPEECH UNDERSTANDING SYSTEMS Summary of Results of the Five-Year Research Effort at Carnegie-Mellon University Carnegie-Mellon University Department of Computer Science Pittsburgh, Pennsylvania 15213 First Version printed September 1976 Present Version printed August 1977 M d R— <h Projects A en, un^coX^no. TSS^l MiF*"™ ™™ B Scientific Research. ™ and monitored by ,h. Air Z^0^!7, PREFACE This report is an augmented version of a report originally issued in September of 1976, during the demonstration at the end of the five-year speech effort.
    [Show full text]
  • Och Lönsamma Öppna Kommunikationssystem
    fcldüh OSI och lönsamma öppna kommunikationssystem Dokumentation av ett seminarium sammanställd av Victor S Epstein med Gunnar Sundblad Tddüh Telestyrelsen har inrättat ett anslag med syfte att medverka tiU snabb och lättillgänglig dokumentation beträffande användningen av teleanknutna informationssystem. Detta anslag förvaltas av TELDOK och skall bidraga tiU: Dokumentation vid tidigast möjliga tidpunkt av praktiska tillämpningar av teleanknutna informationssystem i arbetslivet Publicering och spridning, i förekommande fall översättning, av annars svåråtkomliga erfarenheter av teleanknutna informationssystem i arbetslivet, samt kompletteringar avsedda att öka användningsvärdet för svenska förhållanden och svenska läsare Studieresor och konferenser i direkt anknytning till arbetet med att dokumentera och sprida information beträffande praktiska tillämpningar av teleanknutna informationssystem i arbetslivet Via TELDOK är en av de skriftserier som utges av TELDOK. Via TELDOK presenterar obearbetade tillfallighetsrapporter från seminarier, studieresor osv. Hittills har utgetts: Via TELDOK 1. OSI och lönsamma öppna kommunikationssystem. Maj 1987. Av andra publikationer från TELDOK som nyligen utkommit kan nämnas: TELDOK Kapport 24. Meddelanden att använda. November 1986. TELDOK Kapport 25. Ny teleteknik i Sverige - användning i dag. November 1986. TELDOK Kapport 26. Datorstödda kunskapssystem i framtidens kontor. December 1986. TELDOK Kapport27. Inflytande och DAtorbaserade Kommunikationssystem. April 1987. TELDOK Kapport 28. Ny informationsteknologi i Japan. April 1987. TELDOK Referens dokument G. Management, usage and effects of Office Automation. April 1987. TELDOK-info 4. Att söka i databaser. Mars 1987. Publikationema kan beställas gratis dygnet runt från TeleSvar, 08-23 00 00 (med angivande av rapportnummer). Den som i fortsättningen önskar erhålla skrifter från TELDOK får automatiskt alla TELDOK Kapport och alla TELDOK-info. Ytterligare information lämnas gärna av TELDOK Kedaktionskommitté.
    [Show full text]
  • The Copyright Law of the United States (Title 17, U.S
    NOTICE WARNING CONCERNING COPYRIGHT RESTRICTIONS: The copyright law of the United States (title 17, U.S. Code) governs the making of photocopies or other reproductions of copyrighted material. Any copying of this document without permission of its author may be prohibited by law. CMU Common Lisp User's Manual Mach/IBM RT PC Edition David B. McDonald, Editor April 1989 CMU-CS-89-132 . School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 This is a revised version of Technical Report CMU-CS-87-156. Companion to Common Lisp: The Language Abstract CMU Common Lisp is an implementation of Common Lisp that currently runs on the IBM RT PC under Mach, a Berkeley Unix 4.3 binary compatible operating system. This document describes the implementation dependent choices made in developing this implementation of Common Lisp. Also, several extensions have been added, including the proposed error system, a stack crawling debugger, a stepper, an interface to Mach system calls, a foreign function call interface, the ability to write assembler language routines, and other features that provide a good environment for developing Lisp code. This research was sponsored by the Defense Advanced Research Projects Agency (DOD), ARPA Order No. 4976 under contract F33615-87-C-1499 and monitored by the Avionics Laboratory, Air Force Wright Aeronautical Laboratories, Aeronautical Systems Division (AFSC), Wright-Patterson AFB, OHIO 45433-6543. The views and conclusions contained in this document are those of the authors 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.
    [Show full text]
  • An Implementation of Python for Racket
    An Implementation of Python for Racket Pedro Palma Ramos António Menezes Leitão INESC-ID, Instituto Superior Técnico, INESC-ID, Instituto Superior Técnico, Universidade de Lisboa Universidade de Lisboa Rua Alves Redol 9 Rua Alves Redol 9 Lisboa, Portugal Lisboa, Portugal [email protected] [email protected] ABSTRACT Keywords Racket is a descendent of Scheme that is widely used as a Python; Racket; Language implementations; Compilers first language for teaching computer science. To this end, Racket provides DrRacket, a simple but pedagogic IDE. On the other hand, Python is becoming increasingly popular 1. INTRODUCTION in a variety of areas, most notably among novice program- The Racket programming language is a descendent of Scheme, mers. This paper presents an implementation of Python a language that is well-known for its use in introductory for Racket which allows programmers to use DrRacket with programming courses. Racket comes with DrRacket, a ped- Python code, as well as adding Python support for other Dr- agogic IDE [2], used in many schools around the world, as Racket based tools. Our implementation also allows Racket it provides a simple and straightforward interface aimed at programs to take advantage of Python libraries, thus signif- inexperienced programmers. Racket provides different lan- icantly enlarging the number of usable libraries in Racket. guage levels, each one supporting more advanced features, that are used in different phases of the courses, allowing Our proposed solution involves compiling Python code into students to benefit from a smoother learning curve. Fur- semantically equivalent Racket source code. For the run- thermore, Racket and DrRacket support the development of time implementation, we present two different strategies: additional programming languages [13].
    [Show full text]
  • The Machine That Builds Itself: How the Strengths of Lisp Family
    Khomtchouk et al. OPINION NOTE The Machine that Builds Itself: How the Strengths of Lisp Family Languages Facilitate Building Complex and Flexible Bioinformatic Models Bohdan B. Khomtchouk1*, Edmund Weitz2 and Claes Wahlestedt1 *Correspondence: [email protected] Abstract 1Center for Therapeutic Innovation and Department of We address the need for expanding the presence of the Lisp family of Psychiatry and Behavioral programming languages in bioinformatics and computational biology research. Sciences, University of Miami Languages of this family, like Common Lisp, Scheme, or Clojure, facilitate the Miller School of Medicine, 1120 NW 14th ST, Miami, FL, USA creation of powerful and flexible software models that are required for complex 33136 and rapidly evolving domains like biology. We will point out several important key Full list of author information is features that distinguish languages of the Lisp family from other programming available at the end of the article languages and we will explain how these features can aid researchers in becoming more productive and creating better code. We will also show how these features make these languages ideal tools for artificial intelligence and machine learning applications. We will specifically stress the advantages of domain-specific languages (DSL): languages which are specialized to a particular area and thus not only facilitate easier research problem formulation, but also aid in the establishment of standards and best programming practices as applied to the specific research field at hand. DSLs are particularly easy to build in Common Lisp, the most comprehensive Lisp dialect, which is commonly referred to as the “programmable programming language.” We are convinced that Lisp grants programmers unprecedented power to build increasingly sophisticated artificial intelligence systems that may ultimately transform machine learning and AI research in bioinformatics and computational biology.
    [Show full text]
  • Bringing GNU Emacs to Native Code
    Bringing GNU Emacs to Native Code Andrea Corallo Luca Nassi Nicola Manca [email protected] [email protected] [email protected] CNR-SPIN Genoa, Italy ABSTRACT such a long-standing project. Although this makes it didactic, some Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor limitations prevent the current implementation of Emacs Lisp to family. GNU Emacs can currently execute Elisp code either inter- be appealing for broader use. In this context, performance issues preted or byte-interpreted after it has been compiled to byte-code. represent the main bottleneck, which can be broken down in three In this work we discuss the implementation of an optimizing com- main sub-problems: piler approach for Elisp targeting native code. The native compiler • lack of true multi-threading support, employs the byte-compiler’s internal representation as input and • garbage collection speed, exploits libgccjit to achieve code generation using the GNU Com- • code execution speed. piler Collection (GCC) infrastructure. Generated executables are From now on we will focus on the last of these issues, which con- stored as binary files and can be loaded and unloaded dynamically. stitutes the topic of this work. Most of the functionality of the compiler is written in Elisp itself, The current implementation traditionally approaches the prob- including several optimization passes, paired with a C back-end lem of code execution speed in two ways: to interface with the GNU Emacs core and libgccjit. Though still a work in progress, our implementation is able to bootstrap a func- • Implementing a large number of performance-sensitive prim- tional Emacs and compile all lexically scoped Elisp files, including itive functions (also known as subr) in C.
    [Show full text]
  • The Java® Language Specification Java SE 8 Edition
    The Java® Language Specification Java SE 8 Edition James Gosling Bill Joy Guy Steele Gilad Bracha Alex Buckley 2015-02-13 Specification: JSR-337 Java® SE 8 Release Contents ("Specification") Version: 8 Status: Maintenance Release Release: March 2015 Copyright © 1997, 2015, Oracle America, Inc. and/or its affiliates. 500 Oracle Parkway, Redwood City, California 94065, U.S.A. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. The Specification provided herein is provided to you only under the Limited License Grant included herein as Appendix A. Please see Appendix A, Limited License Grant. To Maurizio, with deepest thanks. Table of Contents Preface to the Java SE 8 Edition xix 1 Introduction 1 1.1 Organization of the Specification 2 1.2 Example Programs 6 1.3 Notation 6 1.4 Relationship to Predefined Classes and Interfaces 7 1.5 Feedback 7 1.6 References 7 2 Grammars 9 2.1 Context-Free Grammars 9 2.2 The Lexical Grammar 9 2.3 The Syntactic Grammar 10 2.4 Grammar Notation 10 3 Lexical Structure 15 3.1 Unicode 15 3.2 Lexical Translations 16 3.3 Unicode Escapes 17 3.4 Line Terminators 19 3.5 Input Elements and Tokens 19 3.6 White Space 20 3.7 Comments 21 3.8 Identifiers 22 3.9 Keywords 24 3.10 Literals 24 3.10.1 Integer Literals 25 3.10.2 Floating-Point Literals 31 3.10.3 Boolean Literals 34 3.10.4 Character Literals 34 3.10.5 String Literals 35 3.10.6 Escape Sequences for Character and String Literals 37 3.10.7 The Null Literal 38 3.11 Separators
    [Show full text]
  • Common Lispworks User Guide
    LispWorks® for the Windows® Operating System Common LispWorks User Guide Version 5.1 Copyright and Trademarks Common LispWorks User Guide (Windows version) Version 5.1 February 2008 Copyright © 2008 by LispWorks Ltd. All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of LispWorks Ltd. The information in this publication is provided for information only, is subject to change without notice, and should not be construed as a commitment by LispWorks Ltd. LispWorks Ltd assumes no responsibility or liability for any errors or inaccuracies that may appear in this publication. The software described in this book is furnished under license and may only be used or copied in accordance with the terms of that license. LispWorks and KnowledgeWorks are registered trademarks of LispWorks Ltd. Adobe and PostScript are registered trademarks of Adobe Systems Incorporated. Other brand or product names are the registered trade- marks or trademarks of their respective holders. The code for walker.lisp and compute-combination-points is excerpted with permission from PCL, Copyright © 1985, 1986, 1987, 1988 Xerox Corporation. The XP Pretty Printer bears the following copyright notice, which applies to the parts of LispWorks derived therefrom: Copyright © 1989 by the Massachusetts Institute of Technology, Cambridge, Massachusetts. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that this copyright and permission notice appear in all copies and supporting documentation, and that the name of M.I.T.
    [Show full text]
  • Omnipresent and Low-Overhead Application Debugging
    Omnipresent and low-overhead application debugging Robert Strandh [email protected] LaBRI, University of Bordeaux Talence, France ABSTRACT application programmers as opposed to system programmers. The state of the art in application debugging in free Common The difference, in the context of this paper, is that the tech- Lisp implementations leaves much to be desired. In many niques that we suggest are not adapted to debugging the cases, only a backtrace inspector is provided, allowing the system itself, such as the compiler. Instead, throughout this application programmer to examine the control stack when paper, we assume that, as far as the application programmer an unhandled error is signaled. Most such implementations do is concerned, the semantics of the code generated by the not allow the programmer to set breakpoints (unconditional compiler corresponds to that of the source code. or conditional), nor to step the program after it has stopped. In this paper, we are mainly concerned with Common Furthermore, even debugging tools such as tracing or man- Lisp [1] implementations distributed as so-called FLOSS, i.e., ually calling break are typically very limited in that they do \Free, Libre, and Open Source Software". While some such not allow the programmer to trace or break in important sys- implementations are excellent in terms of the quality of the tem functions such as make-instance or shared-initialize, code that the compiler generates, most leave much to be simply because these tools impact all callers, including those desired when it comes to debugging tools available to the of the system itself, such as the compiler.
    [Show full text]
  • How Lisp Systems Look Different in Proceedings of European Conference on Software Maintenance and Reengineering (CSMR 2008)
    How Lisp Systems Look Different In Proceedings of European Conference on Software Maintenance and Reengineering (CSMR 2008) Adrian Dozsa Tudor Gˆırba Radu Marinescu Politehnica University of Timis¸oara University of Berne Politehnica University of Timis¸oara Romania Switzerland Romania [email protected] [email protected] [email protected] Abstract rently used in a variety of domains, like bio-informatics (BioBike), data mining (PEPITe), knowledge-based en- Many reverse engineering approaches have been devel- gineering (Cycorp or Genworks), video games (Naughty oped to analyze software systems written in different lan- Dog), flight scheduling (ITA Software), natural language guages like C/C++ or Java. These approaches typically processing (SRI International), CAD (ICAD or OneSpace), rely on a meta-model, that is either specific for the language financial applications (American Express), web program- at hand or language independent (e.g. UML). However, one ming (Yahoo! Store or reddit.com), telecom (AT&T, British language that was hardly addressed is Lisp. While at first Telecom Labs or France Telecom R&D), electronic design sight it can be accommodated by current language inde- automation (AMD or American Microsystems) or planning pendent meta-models, Lisp has some unique features (e.g. systems (NASA’s Mars Pathfinder spacecraft mission) [16]. macros, CLOS entities) that are crucial for reverse engi- neering Lisp systems. In this paper we propose a suite of Why Lisp is Different. In spite of its almost fifty-year new visualizations that reveal the special traits of the Lisp history, and of the fact that other programming languages language and thus help in understanding complex Lisp sys- borrowed concepts from it, Lisp still presents some unique tems.
    [Show full text]
  • The Evolution of Lisp
    1 The Evolution of Lisp Guy L. Steele Jr. Richard P. Gabriel Thinking Machines Corporation Lucid, Inc. 245 First Street 707 Laurel Street Cambridge, Massachusetts 02142 Menlo Park, California 94025 Phone: (617) 234-2860 Phone: (415) 329-8400 FAX: (617) 243-4444 FAX: (415) 329-8480 E-mail: [email protected] E-mail: [email protected] Abstract Lisp is the world’s greatest programming language—or so its proponents think. The structure of Lisp makes it easy to extend the language or even to implement entirely new dialects without starting from scratch. Overall, the evolution of Lisp has been guided more by institutional rivalry, one-upsmanship, and the glee born of technical cleverness that is characteristic of the “hacker culture” than by sober assessments of technical requirements. Nevertheless this process has eventually produced both an industrial- strength programming language, messy but powerful, and a technically pure dialect, small but powerful, that is suitable for use by programming-language theoreticians. We pick up where McCarthy’s paper in the first HOPL conference left off. We trace the development chronologically from the era of the PDP-6, through the heyday of Interlisp and MacLisp, past the ascension and decline of special purpose Lisp machines, to the present era of standardization activities. We then examine the technical evolution of a few representative language features, including both some notable successes and some notable failures, that illuminate design issues that distinguish Lisp from other programming languages. We also discuss the use of Lisp as a laboratory for designing other programming languages. We conclude with some reflections on the forces that have driven the evolution of Lisp.
    [Show full text]
  • Allegro CL User Guide
    Allegro CL User Guide Volume 1 (of 2) version 4.3 March, 1996 Copyright and other notices: This is revision 6 of this manual. This manual has Franz Inc. document number D-U-00-000-01-60320-1-6. Copyright 1985-1996 by Franz Inc. All rights reserved. No part of this pub- lication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, by photocopying or recording, or otherwise, without the prior and explicit written permission of Franz incorpo- rated. Restricted rights legend: Use, duplication, and disclosure by the United States Government are subject to Restricted Rights for Commercial Software devel- oped at private expense as specified in DOD FAR 52.227-7013 (c) (1) (ii). Allegro CL and Allegro Composer are registered trademarks of Franz Inc. Allegro Common Windows, Allegro Presto, Allegro Runtime, and Allegro Matrix are trademarks of Franz inc. Unix is a trademark of AT&T. The Allegro CL software as provided may contain material copyright Xerox Corp. and the Open Systems Foundation. All such material is used and distrib- uted with permission. Other, uncopyrighted material originally developed at MIT and at CMU is also included. Appendix B is a reproduction of chapters 5 and 6 of The Art of the Metaobject Protocol by G. Kiczales, J. des Rivieres, and D. Bobrow. All this material is used with permission and we thank the authors and their publishers for letting us reproduce their material. Contents Volume 1 Preface 1 Introduction 1.1 The language 1-1 1.2 History 1-1 1.3 Format
    [Show full text]