EMACSUSER By Kelly Roach, 26-Sep-84. A few people besides myself (mostly MIT people) have been brought up in the tradition of EMACSing your code rather than DEDITing it. At MIT, the PDP-10 practice is to escape to EMACS, edit your source file a bit, then escape to MACLISP 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 <= <=$ The EMACSUSER package LOADs EMACS which is (more or less) an INTERLISP implementation of a subset of EMACS.