Rcxlisp User Manual

Total Page:16

File Type:pdf, Size:1020Kb

Rcxlisp User Manual RCXLisp User Manual Version 1.3 22 October 2003 © MMII,MMIII, Frank Klassner Dedicated to my AI students, who, since the Fall of 1999, have bravely participated in my quest to make Lego MindStorms a viable platform for collegiate computing curricula. 1 TABLE OF CONTENTS INTRODUCTION ...............................................................................................................................................................1 INSTALLATION.................................................................................................................................................................3 PC INSTALLATION.............................................................................................................................................................3 MAC INSTALLATION..........................................................................................................................................................4 REMOTE RCXLISP...........................................................................................................................................................6 A LIMITED COMMON LISP INTRODUCTION.........................................................................................................6 Optional Arguments....................................................................................................................................................6 Keyword Arguments....................................................................................................................................................7 Using LispWorks.........................................................................................................................................................8 THE “REMOTE RCXLISP” LANGUAGE..................................................................................................................10 Common Lisp I/O Streams & “Remote RCXLisp”................................................................................................................ 10 “Remote RCXLisp” Stream Argument Convention............................................................................................................... 11 Return Values of “Remote RCXLisp” Functions................................................................................................................... 11 RCX::*standard-rcx-io* .......................................................................................................................................................... 15 alivep ........................................................................................................................................................................................ 16 battery-power ........................................................................................................................................................................... 17 change-rcx-id............................................................................................................................................................................ 18 clock.......................................................................................................................................................................................... 19 clock-hour................................................................................................................................................................................. 20 clock-minute............................................................................................................................................................................. 21 current-program........................................................................................................................................................................ 22 download-executable ............................................................................................................................................................... 23 download-firmware.................................................................................................................................................................. 25 effector...................................................................................................................................................................................... 26 firmware ................................................................................................................................................................................... 27 message..................................................................................................................................................................................... 28 play-system-sound ................................................................................................................................................................... 29 play-tone................................................................................................................................................................................... 30 rcx-compile-and-download...................................................................................................................................................... 31 rcx-compile-file........................................................................................................................................................................ 32 rcx-compile-formlist ................................................................................................................................................................ 33 read-rcx-executable.................................................................................................................................................................. 34 send-message............................................................................................................................................................................ 35 sensor........................................................................................................................................................................................ 37 set-clock.................................................................................................................................................................................... 38 set-clock-fields......................................................................................................................................................................... 39 set-clock-hour........................................................................................................................................................................... 40 set-clock-minute....................................................................................................................................................................... 41 set-current-program.................................................................................................................................................................. 42 set-effector-state....................................................................................................................................................................... 43 set-sensor-state......................................................................................................................................................................... 44 set-transmit-range..................................................................................................................................................................... 47 set-var ....................................................................................................................................................................................... 48 shutdown .................................................................................................................................................................................. 49 start-rcx-program ..................................................................................................................................................................... 50 start-rcx-thread......................................................................................................................................................................... 51 start-timer ................................................................................................................................................................................. 52 stop-rcx-thread ......................................................................................................................................................................... 53 timer.......................................................................................................................................................................................... 54 using-rcx................................................................................................................................................................................... 55 var ............................................................................................................................................................................................. 56 with-open-com-port
Recommended publications
  • 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]
  • Writing a Best-Effort Portable Code Walker in Common Lisp
    Writing a best-effort portable code walker in Common Lisp Michael Raskin∗ LaBRI, University of Bordeaux [email protected] ABSTRACT ACM Reference format: One of the powerful features of the Lisp language family is Michael Raskin. 2017. Writing a best-effort portable code walker possibility to extend the language using macros. Some of in Common Lisp. In Proceedings of 10th European Lisp Simpo- sium, Vrije Universiteit Brussel, Belgium, April 2017 (ELS2017), possible extensions would benefit from a code walker, i.e. a 8 pages. library for processing code that keeps track of the status DOI: 10.5281/zenodo.3254669 of different part of code, for their implementation. But in practice code walking is generally avoided. In this paper, we study facilities useful to code walkers 1 INTRODUCTION provided by \Common Lisp: the Language" (2nd edition) and the Common Lisp standard. We will show that the Much of the power of Common Lisp comes from its extensibil- features described in the standard are not sufficient to write ity. Abstractions that cannot be expressed by functions can a fully portable code walker. still be expressed by macros; actually, many of the features One of the problems is related to a powerful but rarely described in the standard must be implemented as macros. discussed feature. The macrolet special form allows a macro Whilst macros are powerful on their own, some ways of function to pass information easily to other macro invocations extending Lisp would benefit from using higher-level code inside the lexical scope of the expansion. transformation abstractions. For many such abstractions the Another problem for code analysis is related to the usage of most natural way to implement them includes code walk- non-standard special forms in expansions of standard macros.
    [Show full text]
  • A Lisp Oriented Architecture by John W.F
    A Lisp Oriented Architecture by John W.F. McClain Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degrees of Master of Science in Electrical Engineering and Computer Science and Bachelor of Science in Electrical Engineering at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 1994 © John W.F. McClain, 1994 The author hereby grants to MIT permission to reproduce and to distribute copies of this thesis document in whole or in part. Signature of Author ...... ;......................... .............. Department of Electrical Engineering and Computer Science August 5th, 1994 Certified by....... ......... ... ...... Th nas F. Knight Jr. Principal Research Scientist 1,,IA £ . Thesis Supervisor Accepted by ....................... 3Frederic R. Morgenthaler Chairman, Depattee, on Graduate Students J 'FROM e ;; "N MfLIT oARIES ..- A Lisp Oriented Architecture by John W.F. McClain Submitted to the Department of Electrical Engineering and Computer Science on August 5th, 1994, in partial fulfillment of the requirements for the degrees of Master of Science in Electrical Engineering and Computer Science and Bachelor of Science in Electrical Engineering Abstract In this thesis I describe LOOP, a new architecture for the efficient execution of pro- grams written in Lisp like languages. LOOP allows Lisp programs to run at high speed without sacrificing safety or ease of programming. LOOP is a 64 bit, long in- struction word architecture with support for generic arithmetic, 64 bit tagged IEEE floats, low cost fine grained read and write barriers, and fast traps. I make estimates for how much these Lisp specific features cost and how much they may speed up the execution of programs written in Lisp.
    [Show full text]
  • Common Lisp Ultraspec – a Project for Modern Common Lisp Documentation
    Common Lisp UltraSpec – A Project For Modern Common Lisp Documentation Michał „phoe” Herda #lisp-pl @ Freenode Jagiellonian University, Cracow, Poland Previously on European Lisp Symposium 2016 Yet Another Rant About The State Of Common Lisp Documentation Michał „phoe” Herda Presenting the European Lisp Symposium 2017 Exclusive: Yet Another Rant About The State Of Common Lisp Documentation, Part 2 Michał „phoe” Herda http://www.lispworks.com/documentation/HyperSpec/... http://www.sbcl.org/manual/... http://ccl.clozure.com/manual/... http://www.clisp.org/... http://bauhh.dyndns.org:8000/clim-spec/... http://bauhh.de/clxman/... http://metamodular.com/CLOS-MOP/... 50+(?) more websites with library-specific docs Fin, Part 2 (...except it’s not) A Possible Solution To The State Of Common Lisp Documentation, Part 2 Michał „phoe” Herda Parsing dpANS with RegEx Parsing HTML (context-free grammar) with RegEx (regular grammar): Parsing TeX (context-sensitive grammar) with RegEx (regular grammar): Parsing a known subset of TeX used in dpANS with RegEx (regular grammar): (with proper care) What’s done so far? ● Done ● All Dictionaries (e.g. MAPCAR, ADJOIN, …) ● Glossary ● Not done / TODO ● Concepts (e.g. 2.2 Reader Algorithm) ● Linking (esp. glossary entries) What’s done so far? ● Done ● All Dictionaries (e.g. MAPCAR, ADJOIN, …) ● Glossary ● Not done / TODO ● Concepts (e.g. 2.2 Reader Algorithm) ● Linking (esp. glossary entries) ● Review ● Diffs to the original dpANS ● Once it’s finished, SHIP IT! What am I aiming for? Editable Complete Downloadable
    [Show full text]
  • Commonloops Merging Lisp and Object-Oriented Programming Daniel G
    CommonLoops Merging Lisp and Object-Oriented Programming Daniel G. Bobrow, Kenneth Kahn, Gregor Kiczales, Larry Masinter, Mark Stefik, and Frank Zdybel Xerox Palo Alto Research Center Palo Alto, California 94304 CommonLoops blends object-oriented programming Within the procedure-oriented paradigm, Lisp smoothly and tightly with the procedure-oriented provides an important approach for factoring design of Lisp. Functions and methods are combined programs that is'different from common practice in in a more general abstraction. Message passing is object-oriented programming. In this paper we inuoked via normal Lisp function call. Methods are present the linguistic mechanisms that we have viewed as partial descriptions of procedures. Lisp data developed for integrating these styles. We argue that types are integrated with object classes. With these the unification results in something greater than the integrations, it is easy to incrementally move a program sum of the parts, that is, that the mechanisms needed between the procedure and object -oriented styles. for integrating object-oriented and procedure-oriented approaches give CommonLoops surprising strength. One of the most important properties of CommonLoops is its extenswe use of meta-objects. We discuss three We describe a smooth integration of these ideas that kinds of meta-objects: objects for classes, objects for can work efficiently in Lisp systems implemented on a methods, and objects for discriminators. We argue that wide variety of machines. We chose the Common Lisp these meta-objects make practical both efficient dialect as a base on which to bui|d CommonLoops (a implementation and experimentation with new ideas Common Lisp Object-Oriented Programming System).
    [Show full text]
  • Successful Lisp - Contents
    Successful Lisp - Contents Table of Contents ● About the Author ● About the Book ● Dedication ● Credits ● Copyright ● Acknowledgments ● Foreword ● Introduction 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 Appendix A ● Chapter 1 - Why Bother? Or: Objections Answered Chapter objective: Describe the most common objections to Lisp, and answer each with advice on state-of-the-art implementations and previews of what this book will explain. ❍ I looked at Lisp before, and didn't understand it. ❍ I can't see the program for the parentheses. ❍ Lisp is very slow compared to my favorite language. ❍ No one else writes programs in Lisp. ❍ Lisp doesn't let me use graphical interfaces. ❍ I can't call other people's code from Lisp. ❍ Lisp's garbage collector causes unpredictable pauses when my program runs. ❍ Lisp is a huge language. ❍ Lisp is only for artificial intelligence research. ❍ Lisp doesn't have any good programming tools. ❍ Lisp uses too much memory. ❍ Lisp uses too much disk space. ❍ I can't find a good Lisp compiler. ● Chapter 2 - Is this Book for Me? Chapter objective: Describe how this book will benefit the reader, with specific examples and references to chapter contents. ❍ The Professional Programmer http://psg.com/~dlamkins/sl/contents.html (1 of 13)11/3/2006 5:46:04 PM Successful Lisp - Contents ❍ The Student ❍ The Hobbyist ❍ The Former Lisp Acquaintance ❍ The Curious ● Chapter 3 - Essential Lisp in Twelve Lessons Chapter objective: Explain Lisp in its simplest form, without worrying about the special cases that can confuse beginners.
    [Show full text]
  • Jon L. White Collection on Common Lisp
    http://oac.cdlib.org/findaid/ark:/13030/c89w0mkb No online items Jon L. White collection on Common Lisp Finding aid prepared by Bo Doub, Kim Hayden, and Sara Chabino Lott Processing of this collection was made possible through generous funding from The Andrew W. Mellon Foundation, administered through the Council on Library and Information Resources' Cataloging Hidden Special Collections and Archives grant. Computer History Museum 1401 N. Shoreline Blvd. Mountain View, CA, 94043 (650) 810-1010 [email protected] March 2017 Jon L. White collection on X6823.2013 1 Common Lisp Title: Jon L. White collection Identifier/Call Number: X6823.2013 Contributing Institution: Computer History Museum Language of Material: English Physical Description: 8.75 Linear feet,7 record cartons Date (bulk): Bulk, 1978-1995 Date (inclusive): 1963-2012 Abstract: The Jon L. White collection on Common Lisp contains material relating to the development and standardization of the programming language Common Lisp and, more generally, the Lisp family of programming languages. Records date from 1963 to 2012, with the bulk of the material ranging from 1978 to 1995, when White was working at MIT’s Artificial Intelligence Laboratory, Xerox PARC (Palo Alto Research Center), Lucid, and Harlequin Group. Throughout many of these positions, White was serving on the X3J13 Committee to formalize a Common Lisp standard, which aimed to combine and standardize many previous dialects of Lisp. This collection consists of conference proceedings, manuals, X3J13 Committee correspondence and meeting minutes, notebooks, technical papers, and periodicals documenting White’s work in all of these roles. Other dialects of Lisp--especially MAClisp--are also major focuses of the collection.
    [Show full text]
  • Basic Lisp Techniques
    Basic Lisp Techniques David J. Cooper, Jr. February 14, 2011 ii 0Copyright c 2011, Franz Inc. and David J. Cooper, Jr. Foreword1 Computers, and the software applications that power them, permeate every facet of our daily lives. From groceries to airline reservations to dental appointments, our reliance on technology is all-encompassing. And, it’s not enough. Every day, our expectations of technology and software increase: • smart appliances that can be controlled via the internet • better search engines that generate information we actually want • voice-activated laptops • cars that know exactly where to go The list is endless. Unfortunately, there is not an endless supply of programmers and developers to satisfy our insatiable appetites for new features and gadgets. Every day, hundreds of magazine and on-line articles focus on the time and people resources needed to support future technological expectations. Further, the days of unlimited funding are over. Investors want to see results, fast. Common Lisp (CL) is one of the few languages and development options that can meet these challenges. Powerful, flexible, changeable on the fly — increasingly, CL is playing a leading role in areas with complex problem-solving demands. Engineers in the fields of bioinformatics, scheduling, data mining, document management, B2B, and E-commerce have all turned to CL to complete their applications on time and within budget. CL, however, no longer just appropriate for the most complex problems. Applications of modest complexity, but with demanding needs for fast development cycles and customization, are also ideal candidates for CL. Other languages have tried to mimic CL, with limited success.
    [Show full text]
  • The Design of TEX and METAFONT: a Retrospective
    The design of TEX and METAFONT: A retrospective Nelson H. F. Beebe University of Utah Department of Mathematics, 110 LCB 155 S 1400 E RM 233 Salt Lake City, UT 84112-0090 USA WWW URL: http://www.math.utah.edu/~beebe Telephone: +1 801 581 5254 FAX: +1 801 581 4148 Internet: [email protected], [email protected], [email protected] Abstract This article looks back at the design of TEX and METAFONT, and analyzes how they were affected by architectures, operating systems, programming languages, and resource limits of the computing world at the time of their creation by a remarkable programmer and human being, Donald E. Knuth. This paper is dedicated to him, with deep gratitude for the continued inspiration and learning that I’ve received from his software, his scientific writing, and our occasional personal encounters over the last 25+ years. 1 Introduction 501 arrived, he was so disappointed that he wrote [68, 2 Computers and people 502 p. 5]: 3TheDECPDP-10 502 I didn’t know what to do. I had spent 15 4 Resource limits 505 years writing those books, but if they were 5 Choosing a programming language 506 going to look awful I didn’t want to write 6 Switching programming languages 510 any more. How could I be proud of such a 7 Switching languages, again 513 product? A few months later, he learned of some new de- 8 TEX’s progeny 514 vices that used digital techniques to create letter 9 METAFONT’s progeny 514 images, and the close connection to the 0s and 1s 10 Wrapping up 515 of computer science led him to think about how 11 Bibliography 515 he himself might design systems to place characters −−∗−− on a page, and draw the individual characters as a matrix of black and white dots.
    [Show full text]
  • Common Lisp Object System
    Common Lisp Object System by Linda G. DeMichiel and Richard P. Gabriel Lucid, Inc. 707 Laurel Street Menlo Park, California 94025 (415)329-8400 [email protected] [email protected] with Major Contributions by Daniel Bobrow, Gregor Kiczales, and David Moon Abstract The Common Lisp Object System is an object-oriented system that is based on the concepts of generic functions, multiple inheritance, and method combination. All objects in the Object System are instances of classes that form an extension to the Common Lisp type system. The Common Lisp Object System is based on a meta-object protocol that renders it possible to alter the fundamental structure of the Object System itself. The Common Lisp Object System has been proposed as a standard for ANSI Common Lisp and has been tentatively endorsed by X3J13. Common Lisp Object System by Linda G. DeMichiel and Richard P. Gabriel with Major Contributions by Daniel Bobrow, Gregor Kiczales, and David Moon 1. History of the Common Lisp Object System The Common Lisp Object System is an object-oriented programming paradigm de- signed for Common Lisp. Over a period of eight months a group of five people, one from Symbolics and two each from Lucid and Xerox, took the best ideas from CommonLoops and Flavors, and combined them into a new object-oriented paradigm for Common Lisp. This combination is not simply a union: It is a new paradigm that is similar in its outward appearances to CommonLoops and Flavors, and it has been given a firmer underlying semantic basis. The Common Lisp Object System has been proposed as a standard for ANSI Common Lisp and has been tentatively endorsed by X3J13.
    [Show full text]