XEROX GLISP 2 4 1 GLISP 1 4 By: Gordon S. Novak, Jr. (AI.NOVAK@UTEXAS-20.ARPA) Uses files GLISPA, GLISPB, GLISPDWINDOW, GLISPGEV, GLISPGEVAUX, GLIEPGEVTYPE, GLISPR, GLISPTEST.LSP, GLISPVECTOR.LSP SUMMARY GLISP is a Lisp-based language that provides high-level language features not found in ordinary Lisp. The GLISP language is implemented by means of a compiler that accepts GLISP as input and produces ordinary Lisp as output; this output can be further compiled to machine code by the Lisp compiler. GLISP and its environment editor GEV is documented in memos available from the Stanford University Computer Science department: GLisp User'S Manual, by Gordon S. Novak Jr. STAN-CS-82-895, revised. HPP-82-1. The GEV Display Inspector/Editor, Technical Report HPP-82-32. The file GLISP.TTY, included with the LispUsers release, includes the GLISP User's Manual in text form. The following is taken from the GLisp User's Manual. INTRODUCTION The goal of GLISP is to make programming easier by allowing design decisions to be expressed in a single place and letting the compiler generate code according to those design decisions. This philosophy allows source program code to be shorter and more readable and allows design decisions to be changed without requiring that program code be rewritten. GLISP provides both Pascal-like and English-like syntaxes; much of the power and brevity of GLISP derives from the compiler features necessary to support the relatively informal, English-like language constructs. The following example of a GLISP function illustrates the use of definite reference to structured objects. (HourlySalaries (GLAMBDA (D:DEPARTMENT) (for each EMPLOYEE who is HOURLY (PRIN1 NAME) (SPACES 3) (PRINT SALARY) ) )) The features provided by GLISP include the following: 1. GLISP maintains knowledge of object types and of the "context" of the computation as the program is compiled. Features of objects that are in context may be referenced directly; the compiler will determine how to reference the objects given the current context and will add the newly referenced objects to the context. In the example above, the function's argument, an object whose class is DEPARTMENT, establishes an initial context relative to which EMPLOYEEs can be found. In the context of an EMPLOYEE, NAME and SALARY can be found. 2. GLISP supports flexible object definition and reference with a powerful abstract data type facility. Object classes are easily declared to the system. An object declaration includes a definition of the storage structure of the object and declarations of properties of the object; these may be declared in such a way that they compile open, resulting in efficient object code. 3. GLISP supports object-centered programming, in which processes are invoked by means of "messages" sent to objects. Object structures may be Lisp structures (for which code is automatically compiled) or units in the user's favorite representation language (for which the user can supply compilation functions). 4. Pascal-like control statements and loop constructs, such as (FOR EACH WITH DO . . .) , are compiled into Lisp code of the appropriate form. 5. Compilation of infix expressions is provided for the arithmetic operators and for additional operators that facilitate list manipulation. Operators are interpreted appropriately for Lisp data types as well as for numbers; operator overloading for user-defined objects is provided by the message facility. 6. The GLISP compiler infers the types of objects when possible and uses this knowledge to generate efficient object code. By performing compilation relative to a knowledge base, GLISP is able to perform certain computations (e.g., inheritance of an attached procedure from a parent class of an object in a knowledge base) at compile time rather than at run time, resulting in much faster execution. 7. By separating object definitions from the code that references objects, GLISP permits radical changes to object structures with no changes to code. (LIST ((PAGE NIL (FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))((8( (8D PAGEHEADING RUNNINGHEADTERMINAL MODERN MODERN MODERN MODERNLOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN 4v+P? c@*%16};@*96Jz