
Job ID: printopdf-20 Title: Symbolics Common Lisp Language Concepts Requesting User: genera Billing Info: {job-billing} UNIX asy Printing E System S oftware C P roducts SymbolicsCommonLispLanguageConcepts OrganizationofSymbolicsCommonLispDocumentation Symbolics Common Lisp (SCL) is the Symbolics implementation of the Lisp lan guage. Lisp is a powerful and complex tool that can be used at many levels, by people with widely varying programming experience. SCL is therefore intended to serve a user spectrum that ranges from the novice programmer to the experienced Lisp developer.These two factsmotivate the organization of this documentation in toseveralparts,eachreflectingadifferentstageoffamiliaritywithLisp. For an overview of Symbolics Common Lisp, see the section "Overview of Symbol ics Common Lisp". This section is intended primarily as a learning aid to give the new user an introduction to key SCL concepts. The Overview does not present topics in any detail. Rather, it is aimed at giving the new user a general sense of each topic, including definitions of basic terms and simple examples of important concepts.Itisdesignedtobereadsequentially,inasinglesittingifdesired. If you are unfamiliar with the Symbolics notation conventions for Lisp documenta tion,seethesection"UnderstandingNotationConventions". Your reference guide to Symbolics Common Lisp (SCL), the Symbolics implementa tionoftheLisplanguage,consistsofthefollowingvolumes: SymbolicsCommonLispLanguageConcepts Documents the basic language concepts of Lisp, including data types, type specifiers, functions and dynamic closures, inline functions and macros, eval uation,scoping,flowofcontrol,declarations,andcompatibilityissues. SymbolicsCommonLispProgrammingConstructs Documents the higherlevel programming constructs of Lisp, including structures, CLOS, Flavors, conditions, packages, and input/output facilities (including the reader, printed representation, input and output functions, andstreams). SymbolicsCommonLispDictionary An alphabetic dictionary of all Lisp objects documented in the previous two volumes. The first two volumes give a conceptual presentation of Symbolics Common Lisp, and provide indepth coverage of topics presented in the Overview. The Dictionary is the most detailed part of the documentation. This is a true dictionary of refer ence entries for all Symbolics Common Lisp symbols. Each entry provides a com plete description of a single Lisp object. For example, the entry for a given SCL function would include its syntax, what it returns, examples of its use and cross references to related functions or topics. The entries are alphabetized and thumb tabs are provided for rapid access to information about an individual symbol when you need it. Because the dictionary entries appear in alphabetical order, this vol ume of Symbolics Common Lisp is not indexed; the other volumes are fully in dexed. Page 6 UnderstandingNotationConventions You should understand several notation conventions before reading the documenta tion. LispObjects Functions AtypicaldescriptionofaLispfunctionlookslikethis: functionname arg1arg2&optionalarg3(arg4(foo3)) function Adds together arg1 and arg2, and then multiplies the result by arg3. If arg3 is not provided, the multiplication is not done. functionname returns a list whose first element is this result and whose second element is arg4. Exam ples: (functionname34)=>(74) (functionname122’bar)=>(6bar) The word "&optional" in the list of arguments tells you that all of the arguments past this point are optional. The default value of an argument can be specified ex plicitly, as with arg4, whose default value is the result of evaluating the form (foo 3). If no default value is specified, it is the symbol nil. This syntax is used in lambdalists in the language. (For more information on lambdalists, see the sec tion "Evaluating a Function Form".) Argument lists can also contain "&rest", whichispartofthesamesyntax. Note that the documentation uses several fonts, or typefaces. In a function de scription, for example, the name of the function isin boldface in the first line, and the arguments are in italics. Within the text, printed representations of Lisp ob jects are in the same boldface font, such as (+ foo 56), and argument references areitalicized,suchasarg1andarg2. Otherfontsareusedasfollows: "Typein"or"example"font(functionname) Indicates something you are expected to type. This font is also used for Lisp examples that are set off from the text and in some cases for information, such as a prompt, that appears on thescreen. "Key"font(RETURN,c-L) Forkeystrokesmentionedinrunningtext. MacrosandSpecialForms The descriptions of special forms and macros look like the descriptions of these imaginaryones: Page 7 dothreetimes form SpecialForm Evaluatesformthreetimesandreturnstheresultofthethirdevaluation. withfooboundtonil form... Macro Evaluatestheformswiththesymbolfooboundtonil.Itexpandsasfollows: (withfooboundtonil form1 form2...)==> (let((foonil)) form1 form2...) Since special forms and macros are the mechanism by which the syntax of Lisp is extended, their descriptions must describe both their syntax and their semantics; unlike functions, which follow a simple consistent set of rules, each special form is idiosyncratic. The syntax is displayed on the first line of the description using the followingconventions. • Italicized words are names of parts of the form that are referred to in the de scriptive text. They are not arguments, even though they resemble the italicized wordsinthefirstlineofafunctiondescription. • Parentheses("( )")standforthemselves. • Brackets("[ ]")indicatethatwhattheyencloseisoptional. • Ellipses ("...") indicate that the subform (italicized word or parenthesized list) that precedes them can be repeated any number of times (possibly no times at all). • Braces followed by ellipses ("{ }...") indicate that what they enclose can be re peated any number of times. Thus, the first line of the description of a special form is a "template" for what an instance of that special form would look like, withthesurroundingparenthesesremoved. The syntax of some special forms is too complicated to fit comfortably into this style; the first line of the description of such a special form contains only the name,andthesyntaxisgivenbyexampleinthebodyofthedescription. The semantics of a special form includes not only its contract, but also which sub forms are evaluated and what the returned value is. Usually this is clarified with oneormoreexamples. A convention used by many special forms is that all of their subforms after the first few are described as "body...". This means that the remaining subforms con stitute the "body" of this special form; they are Lisp forms that are evaluated one afteranotherinsomeenvironmentestablishedbythespecialform. Thisimaginaryspecialformexhibitsallofthesyntacticfeatures: Page 8 twiddlefrob [(froboption...)]{parametervalue}... SpecialForm Twiddles the parameters of frob, which defaults to defaultfrob if not speci fied. Each parameter is the name of one of the adjustable parameters of a frob; each value is what value to set that parameter to. Any number of parameter/value pairs can be specified. If any options are specified, they are keywords that select which safety checks to override while twiddling the pa rameters. If neither frob nor any options are specified, the list of them can beomittedandtheformcanbegindirectlywiththefirstparametername. frob and the values are evaluated; the parameters and options are syntactic keywords and are not evaluated. The returned value is the frob whose pa rameterswereadjusted.Anerrorissignalledifanysafetycheckisviolated. Flavors,FlavorOperations,andInitOptions Flavorsthemselvesaredocumentedbythenameoftheflavor. Flavor operations are described in three ways: as methods, as generic functions, and as messages. When it is important to show the exact flavor for which the method is defined, methods are described by their function specs. Init options are documentedbythefunctionspecofthemethod. When a method is implemented for a set of flavors (such as all streams), it is doc umentedbythenameofmessageorgenericfunctionitimplements. Thefollowingexamplesaretakenfromthedocumentation. sys:networkerror Flavor This set includes errors signalled by networks. These are generic network errors thatareuseduniformlyforanysupportednetworks.Thisflavorisbuiltonerror. (flavor:method:clearwindowtv:sheet) Method Erases the whole window and move the cursor position to the upper left corner of thewindow. :tyo char Message Puts the char into the stream. For example, if s is bound to a stream, then the followingformwilloutputa"B"tothestream: (sends:tyo#\B) For binary output streams, the argument is a nonnegative number rather than specificallyacharacter. dbg:specialcommandp conditionspecialcommand Function Page 9 Returns t if commandtype is a valid Debugger special command for this condition object;otherwise,returnsnil. Thecompatiblemessagefordbg:specialcommandpis: :specialcommandp For a table of related items,see the section "Basic Condition Methods and Init Op tions". (flavor:method:bottomtv:sheet) bottomedge InitOption Specifiestheycoordinateofthebottomedgeofthewindow. Variables Descriptionsofvariables("special"or"global"variables)looklikethis: *typicalvariable* Variable Thevariable*typicalvariable*hasatypicalvalue.... MacroCharacters Macro characters are explained in detail in the documentation. See the section "HowtheReaderRecognizesMacroCharacters". The single quote character (’) and semicolon (;)
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages444 Page
-
File Size-