XEROX EMACSUSER 2 4 1 EMACSUSER 1 4 By: Kelly Roach (Roach.pa@Xerox.com) A few people besides myself have been brought up in the tradition of EMACSing your code rather than DEDITing it. The usual practice is to escape to EMACS, edit your source file a bit, then escape to LISP with the editted code loaded in. This package defines a few functions and clisp words to support this kind of activity. (1) FUNCTION DEFINITION. Functions can be defined with clisp words DEFEXPR and DEFFEXPR: => (DEFEXPR . ) ! (DEFFEXPR . ) => ( . ) => ! (OPTIONAL ) ! (OPTIONAL ) ! (REST ) ! (REST ) The in a is a list of expressions that PROGN might take. The should be a list of the obligatory formals (if any), followed by the optional formals (if any), followed by the rest formal (if there is one). Functions defined using DEFEXPR expand into LAMBDA forms and they're actuals are EVALuated before being called. Functions defined using DEFFEXPR expand into NLAMBDA forms and they're actuals are not EVALuated before being called. Examples: (DEFEXPR (FOO X (OPTIONAL Y 3) (REST Z 'MEEF)) (LIST X Y Z)) (FOO) => (NIL 3 MEEF) (FOO 4 5) => (4 5 MEEF) (FOO 4 5 6 7) => (4 5 (6 7)) (DEFFEXPR (BAR X (REST Y)) (LIST 'TIMES X (CONS 'PLUS Y))) (BAR 1 2 3) => (TIMES 1 (PLUS 2 3)) (BAR A B C) => (TIMES A (PLUS B C)) (2) ARITHMETIC. Shorter function names for arithmetic functions are supplied. FIXP FLOATP PLUS + +$ TIMES x x$ DIFFERENCE - -$ MINUS 0- 0-$ QUOTIENT / /$ REMAINDER \ \$ ADD1 1+ 1+$ SUB1 1- 1-$ GTHAN > >$ GEQUAL >= >=$ NEQUAL <> <>$ EQUAL = =$ LTHAN < <$ LEQUAL <= <=$ (3) BQUOTE & SETF. This package also LOADs BQUOTE & SETF. (4) LOAD, EFILE & ECOMPL. You can LOAD an EMACS file just like you would LOAD a filepackage file. But to keep LOAD happy, you have to have the atom STOP at the end of your file. You can convert an EMACS source file into a typical INTERLISP filepackage source file and compile it. To create a filepackage file from an EMACS file, use (EFILE FILE TOFILE) The function (ECOMPL FILE) does an EFILE followed by a TCOMPL. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# NIL) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEADTERMINAL MODERN MODERNLOGOMODERN MODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN &GZmæñ<N­FQ $ h8zº