AD-A259 III LI Ii I Technical Report -MIT Scheme Reference .

3y ago
35 Views
2 Downloads
8.91 MB
250 Pages
Last View : 8d ago
Last Download : 3m ago
Upload by : Kaleb Stephen
Transcription

lii lIInIIIlI iii 53511111(\"AD-A259Technical Report 1281-MIT SchemeReference ManualDTIC93SJASELECTEICChris HansoMIT Artificial Intelligence LaboratoryAppioved tar pr.,.c rsiec#t'!93-01048-h981 21 036

Form ApprovedREPORT DOCUMENTATION PAGE0MB No. 0704-0188Public reporting burden for this collection of information is estimated to average I hour per response. Including the time for reviewing Instructions. searching existinq data sources.gathering and maintaining the data needed. and completing and reviewing the collection of Information. Send comments regarding this burden estimate or any other aspect of thiscollection of Information. including suggestions for reducing this burden, to Washington Headquarters Services. Oirectorate for infori ation Operations and Reports,. 121I JeffersonDavis tighway. Suite 1204. Arlington. VA 22202-4302. and to the Office of Management and Sludget. Paperwork Reduction Prolect (0104.018t). Washington. OC 205031. AGENCY USE ONLY (Leave blank)2. REPORT DATE3. REPORT TYPE AND DATES COVEREDtechnical reportJanuary 19914. TITLE AND SUBTITLES. FUNDING NUMBERSMIT Scheme Reference ManualNO0014-85-K-0124N00014-86-K-01806. AUTHOR(S)Chris Hanson7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES)B. PERFORMING ORGANIZATIONREPORT NUMBERArtificial Intelligence Laboratory545 Technology SquareCambridge, Massachusetts 02139AI-TR 12819. SPONSORINGI MONITORING AGENCY NAME(S) AND ADDRESS(ES)10. SPONSORING/ MONITORINGAGENCY REPORT NUMBEROffice of Naval ResearchInformation SystemsArlington, Virginia2221711. SUPPLEMENTARY NOTESNone12a. DISTRIBUTION I AVAILABILITY STATEMENTDistribution of this document is12b. DISTRIBUTION CODEunlimited13. ABSTRACT (Maximum 200 words)MIT Scheme is an implementation of the Scheme programming languagethat runs on many popular workstations.The MIT Scheme ReferenceManual describes the special forms, procedures, and datatypes providedby the implementation for use by application programmers.14. SUBJECT TERMS(key words)IS. NUMBER OF PAGES24816. PRICE CODE17. SECURITY CLASSIFICATIONOF REPORT18. SECURITY CLASSIFICATIONOF THIS PAGE19. SECURITY CLASSIFICATIONOF ABSTRACTUNCLASSIFIEDUNCLASSIFIEDUNCLASSIFIEDNSN 7540-01-280-SS0020. LIMITATION OF ABSTRACTUNCLASSIFIEDStandard Form 298 (Rev 2-89)Prescribed by ANSI Sid 1391 291.102

MIT Scheme. Reference ManualEdition 1.1for Scheme Release 7.1.3November 1991ITIC QUjALITY 114VEMTED 5Acaas.1@tWe!ot -0 Distrib'mtionfAvailability 096&g!Distby Chris Hansonthe MIT Scheme Teamand a cast of thousandsSpecial13

Copyright @ 1988, 1989, 1990, 1991 Massachusetts Institute of TechnologyThis material was developed by .the Scheme project at the Massachusetts Institute of Technology,Departhent oqf Eleqrical Engineering and Computer Science. Permission to copy this document,to redtstribufL, and. to use it for any purpose is granted, subject to the following restrictions andunderstandings. ,.1.* Any copy made of this document must include this copyright notice in full.2. Users of this document agree to make their best efforts (a) to return to the MIT Schemeproject any, improvements or extensions that they make, so that these may be included infuture releases; and (b) to inform MIT of noteworthy uses of this document.3. All materia1h developed as a consequence of the use of this document shall duly acknowledgesuch use, in accordance with the usual standards of acknowledging credit in academic research.,.MIT has made no warrantee or representation that the contents of this document will be errorfree, and MIT is under no obligation to provide any services, by way of maintenance, update,or otherwise.5. In conjunction with products arising from the use of this material, there shall be no use ofthe name of the Massachusetts Institute of Technology nor of any adaptation thereof in anyadvertising, promotional, or sales literature without prior written consent from MIT in eachcase.

Short ContentsAcknowledgements .1 Overview .2 Special Forms .345Equivalence Predicates .Num bers .Characters .6 Strings .7 Lists .8 Vectors .9 Bit Strings .10 Miscellaneous Datatypes .11 Associations .12 Procedures .13 Environments .14 Input/Output .15 File-System Interface .16 Error System .17 Graphics .Index of Procedures, Special Forms, and Variables .Index of Concepts 7

iiMITScheme Reference

Table of ContentsAcknowledgements .113Overview .1.11.21.31.42Notational Conventions . 41.1.1 Errors . 41.1.2 Exam ples . 51.1.3 Entry Format . 5Scheme Concepts . 71.2.1 Variable Bindings . 71.2.2 Environment Concepts . 81.2.3 Initial and Current Environments . 81.2.4 Static Scoping . 91.2.5 True and False . 101.2.6 External Representations . 101.2.7 Disjointness of Types . 111.2.8 Storage Model . 11Lexical Conventions . 121.3.1 W hitespace . 121.3.2 Delimiters . 121.3.3 Identifiers . 131.3.4 Uppercase and Lowercase . 141.3.5 Naming Conventions . 141.3.6 Comments . 141.3.7 Additional Notations . 15Expressions . 161.4.1 Literal Expressions . 161.4.2 Variable References . 161.4.3 Special Form Syntax . 171.4.4 Procedure Call Syntax . 17Special Forms .2.12.22.32.4Lambda Expressions .Lexical Binding .Fluid Binding .Definitions .2.4.1 Top-Level Definitions .2.4.2 Internal Definitions .19192124262627

MIT Scheme Referenceiv28283134352.5 Assignments .2.6 Quoting .2.7 Conditionals .2.8 Sequencing .2.9 Iteration .3Equivalence Predicates .394Numbers .454.14.24.34.44.54.64.75Characters .5.15.25.35.45.55.66Numerical types .Exactness .Implementation restrictions .Syntax of numerical constants .Numerical operations .Numerical input and output .Fixnum and Flonum Operations .4.7.1 Fixnum Operations .4.7.2 Flonum Operations .External Representation of Characters .Comparison of Characters .Miscellaneous Character Operations .Internal Representation of Characters .ASCII Characters .Character Sets .Strings .6.16.26.36.46.56.66.76.86.96.10Construction of Strings .Selecting String Components .Comparison of Strings .Alphabetic Case in Strings .Cutting and Pasting Strings .Searching Strings .M atching Strings .Modification of Strings .Variable-Length Strings .Byte Vectors 38485

V789Lists .11887.1Pairs .7.27.37.47.57.67.77.8Construction of Lists . 91Selecting List Components . 93Cutting and Pasting Lists . 94Filtering Lists . 96Searching Lists . 98M apping of Lists . 98Reduction of Lists . 1007.9Miscellaneous List Operations .Vectors .1011038.18.28.3Construction of Vectors .Selecting Vector Components .Cutting Vectors .1031041058.4Modifying Vectors .106Bit Strings .9.19.29.39.49.59.61087Construction of Bit Strings .Selecting Bit String Components .Cutting and Pasting Bit Strings .Bitwise Operations on Bit Strings .Modification of Bit Strings .Integer Conversions of Bit Strings .107107108108109110111Miscellaneous Datatypes . 11310.110.210.310.4Booleans .Sym bols .Cells .Records .11311411811910.510.610.7Promises .Stream s .Weak Pairs .121123125Associations .12911.111.211.311.4Association Lists .1D Tables .The Association Table .Hash Tables .12913213313411.5Hashing .138

vi12MIT Scheme ReferenceProcedures .12.112.212.312.413Procedure Operations .Primitive Procedures .Continuations .Application Hooks .Environments .13.113.213.313.414141141143143146149Environment Operations .Environment Variables .REPL Environment .Interpreter Environments .Input/Output .15314.1 Ports .14.2 File Ports .14.3 String Ports .14.4 Input Procedures .14.5 Output Procedures .14.6 Format .14.7 Custom Output .14.8 Port Primitives .14.8.1 Input Port Primitives .14.8.2 Output Port Primitives .15File-System Interface 155157158161162165167168170175Pathnam es .15.1.1 Filenames and Pathnames .15.1.2 Components of Pathnames .15.1.3 Operations on Pathnames .Working Directory .File Manipulation .Directory Reader .Error System .1491501511511751761771811831841861.87Sim ple Errors .Error Handler .Error M essages .Condition Types .Condition Instances .Condition Signalling .Condition Handling .188190190192193195196

vii16.817Predefined Errors .Graphics .19719917.1 Opening and Closing of Graphics Devices .17.2 Coordinates for Graphics .17.3 Drawing Graphics .17.4 Characteristics of Graphics Output .17.5 Buffering of Graphics Output .17.6 Clipping of Graphics Output .17.7 Custom Graphics Operations .17.8 X Graphics .17.8.1 X Graphics Type .17.8.2 Utilities for X Graphics .17.8.3 Custom Operations on X Graphics Devices .17.9 Starbase Graphics .199200201202204205205206206207208210Index of Procedures, Special Forms, and Variables. 213Index of Concepts .227

viiiMIT Scheme Reference

AcknowledgementsAcknowledgementsWhile "a cast of thousands" may be an overstatement, it is certainly the case that this documentrepresents the work of many people. First and foremost, thanks go to the authors of the Revised-4Report on the Algorithmic LanguageScheme, from which much of this document is derived. Thanksalso to BBN Advanced Computers Inc. for the use of parts of their Butterfly Scheme Reference,and to Margaret O'Connell for translating it from BBN's text-formatting language to ours.Special thanks to Richard Stallman, Bob Chassell, and Brian Fox, all of the Free SoftwareFoundation, for creating and maintaining the Texinfo formatting language in which this documentis written.This report describes research done at the Artificial Intelligence Laboratory of the MassachusettsInstitute of Technology. Support for the laboratory's artificial intelligence research is provided inpart by the Advanced Research Projects Agency of the Department of Defense under Office ofNaval Research contracts N00014-85-K-0124 and N00014-86-K-0180.

MIT Scheme Reference

Chapter 1: Overview31 OverviewThis manual is a detailed description of the MIT Scheme runtime system. It is intended to bea reference document for programmers. It does not describe how to run Scheme or how to interactwith it - that is the subject of the MIT Scheme User's Manual.This chapter summarizes the semantics of Scheme, briefly describes the MIT Scheme programming environment, and explains the syntactic and lexical conventions of the language. Subsequentchapters describe special forms, numerous data abstractions, and facilities for input and output.Throughout this manual, we will make frequent references to standard Scheme, which is the language defined by the document Revised'4 Report on the Algorithmic Language Scheme, by WilliamClinger, Jonathan Rees, et al., or by IEEE Std. 1178-1990, IEEE Standard for the Scheme Programming Language (in fact, several parts of this document are copied from the Revised Report).MIT Scheme is an extension of standard Scheme.These are the significant semantic characteristics of the Scheme language:Variables are statically scopedScheme is a statically scoped programming language, which means that each use ofa variable is associated with a lexically apparent binding of that variable. Algol isanother statically scoped language.Types are latentScheme has latent types as opposed to manifest types, which means that Scheme associates types with values (or objects) rather than with variables. Other languages withlatent types (also referred to as weakly typed or dynamically typed languages) includeAPL, Snobol, and other dialects of Lisp. Languages with manifest types (sometimesreferred to as strongly typed or statically typed languages) include Algol 60, Pascal,and C.Objects have unlimited extentAll objects created during a Scheme computation, including procedures and continuations, have unlimited extent; no Scheme object is ever destroyed. The system doesn'trun out of memory because the garbage collector reclaims the storage occupied by anobject when the object cannot possibly be needed by a future computation. Otherlanguages in which most objects have unlimited extent include APL and other Lispdialects.Proper tail recursionScheme is properly tail-recursive, which means that iterative computation can occur

4MIT Scheme Referencein constant space, even if the iterative computation is described by a syntacticallyrecursive procedure. With a tail-recursive implementation, you can express iterationusing the ordinary procedure-call mechanics; special iteration expressions are providedonly for syntactic convenience.Procedures axe objectsScheme procedures are objects, which means that you can create them dynamically,store them in

guage defined by the document Revised'4 Report on the Algorithmic Language Scheme, by William Clinger, Jonathan Rees, et al., or by IEEE Std. 1178-1990, IEEE Standard for the Scheme Pro-gramming Language (in fact, several parts of this document are copied from the Revised Report). MIT Scheme is an extension of standard Scheme.

Related Documents:

MIL-STD-1388-1a. It defines, organizes, tracks, models and reports on procedures that are used to develop supportability concepts. This particular module (one of four) fulfills the requirements of LSA Task 101, "Early LSA Strategy". To effectively utilize ALSAT this manual should be

Brendan Dooley Springfield III AC Ryon Lynch Springfield III AC Mike Schiamanna St. Anselm III HC Zak Bussey St. John Fisher III AC Don Fleming St. Joseph's III AC Tom Rotanz St. Joseph's III HC Patrick Tuohy Stevens III AC Dominic DeFazio Stevenson III AC Tim Puls Stevenson III AC Jare

opportunities and case for future investment solutions. The scope of the study covered the A27 from its junction with the M27 in the west and its junction with the A259 in the east. The study highlighted the single carriageway areas of the A27 as areas for investment, namely Arundel, Worthing–Lancing and East of Lewes. The A27 Corridor .

Elba A. Dardeau, Jr., Thomas E. Schaefer, Jr., Anthony C. Gibson Environmental Laboratory DEPARTMENT OF THE ARMY Waterways Experiment Station, Corps of Engineers 3909 Halls Ferry Road, Vicksburg, Mississippi 39180-6199 DTI.ANO 1993 /I 7 November 1992 8 Final Report Approved For Public Release

sliding smoothly past low cloud, above the A259 bridge. It was December 5th, . but though I did not know it, thousands of miles away, Nelson Mandela lay dying, bringing to an end one chapter in the history of South Africa, a country most gifted by nature and much . Biggleswade" according to the slip transfer on the dash.

Abattage des roches b. Foration c. Tir d. Chargement et transport CHAPITRE III CALCUL DE LA STABILITE DES TALUS DE LA CARRIERE DE AIN EL KEBIRA III .1. INTRODUCTION III .2. DETERMINATION DES PROPRIETES MECANIQUES DES ROCHES III.2.1. Résistance a la compression III.2.2. Résistance a la traction III.2.3. Cohésion et angle de frottement interne d’un échantillon III.2.4. Fissuration des .

Reference Charts for New Testament Textual Criticism / 5 Greek Manuscripts Ms Contents Date Trad. Text Type Aland Category Papyri (Egypt) 1 e III A I-s 2 e VI “mixed” III 3 e VI/VII A III 4 e III A I-n 5 e III W I-n 6 e IV II 7 e III-IV? IV-VI? A too brief 8 a IV “mixed A/W” II 9 c III I-f? 10 p IV A I 11 p VII A II

English Language Arts Model Curriculum with Instructional Supports . Code . Standard . Reading Standards for Literature Key Ideas and details . RL.2.1 . Ask and answer such questions as who, what, where, when, why, and how to demonstrate understanding of key details in a text. RL.2.2 : Analyze literary text development. a. Determine the lesson or moral. b. Retell stories, including fables and .