This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorials:interlisp [2024/10/04 06:51] papa |
tutorials:interlisp [2024/10/09 01:58] (current) papa |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== TWENEX Interlisp Tutorial ====== | ====== TWENEX Interlisp Tutorial ====== | ||
- | **Interlisp-10**, | + | **Interlisp-10**, |
- | The language became popular with Stanford University AI researchers and at other principly | + | The language became popular with Stanford University AI researchers and at other principally |
- | Interlisp | + | ===== Interlisp |
+ | |||
+ | At the time of its creation, what distinguished Interlisp from most other programming languages and systems was that it attempted to provide the user with a complete set of tools for making it possible for him or her to accomplish | ||
+ | |||
+ | * **Editor** | ||
+ | * **Break package** -- A package for giving control to he user when an error occurs so variable values can be examined and other tests preformed. It also includes the ability to set breakpoints and trace functions. | ||
+ | * **File package** -- A set of functions which are fully integrated into the system to keep track of what files source and compiled versions of functions reside, and automatically maintaining updated versions of these files when changes are made. | ||
+ | * **Record package** -- A package for creating record structures which allow one's code to be written independent of the data structures acutally chosen for the implementation. | ||
+ | * **DWIM** -- "Do What I Mean" -- a spelling corrector which attempts to fix spelling errors and other obvious mistakes. | ||
+ | * **CLISP** -- " | ||
+ | * **Helpsys** -- An on-line help and documentation facility. //(Not available on TWENEX.)// | ||
+ | * **Masterscope** -- A program for analyzing the structure of large programs and answering questions like "What functions call FOO" or "EDIT functions which reference MUMBLE freely" | ||
===== In and Out ===== | ===== In and Out ===== | ||
- | Start Interlisp with the EXEC command '' | + | Start Interlisp with the EXEC command '' |
- | **Note: | + | ===== Interlisp |
- | ===== Example Session ===== | + | * Although the Interlisp programming language is not identical to Lisp 1.5, Clark Weissman' |
+ | * The Interlisp top-level prompt character is a " | ||
+ | * The Interlisp top-level allows expressions to be entered over multiple lines. Type a carriage-return to continue input on a new line. To make Interlisp evaluate an input expression, type a right parenthesis to close the last open left parenthesis. (Interlisp will append a carriage-return automatically.) | ||
+ | * The Interlisp top-level accepts commands in either of two formats: | ||
+ | - EVAL format: '' | ||
+ | - EVALQUOTE format: ''// | ||
+ | * Interlisp supports both upper- and lower-case characters, and names are case-sensitive. Names of core functions are defined in uppercase, but the DWIM facility can automatically correct incorrect capitalization. | ||
+ | * The Interlisp read program treats square brackets (" | ||
+ | * You can insert comments in your Interlisp code with '' | ||
+ | * Type a single quotation mark ("'" | ||
+ | * Type a percent sign (" | ||
+ | * Type "?=" followed by a carriage-return at any point during input to be given the argument names and corresponding values (if any) of the expression (form) being typed. | ||
- | ^ ^ Notes ^ | + | ===== Interlisp Control Characters ===== |
- | |'' | + | |
- | |'' | + | |
- | |'' | + | |
- | 4_(GETD | + | |Ctrl-C|Return to EXEC. Interlisp can be resumed with '' |
- | (LAMBDDA (N) (IF N=0 THEN NIL ELSE N* (FACTT | + | |Ctrl-D|Return to Interlisp top-level. | |
- | 5_FACT(3) | + | |Ctrl-N|Call Interlisp editor on the expression being read, when the __read__ is completed. | |
- | LAMBDDA {below FACT} -> LAMBDA ? Yes | + | |Ctrl-O|Clear output buffer. | |
- | FACTT {in FACT} -> FACT ? Yes | + | |Ctrl-U|Print "##" |
+ | |Ctrl-V|Escape the following control character that would otherwise interrupt the input process. | | ||
+ | |Ctrl-W|Erase the last // | ||
+ | |Backspace|Erase the last character typed in, echoing a " | ||
- | NON-NUMERIC ARG | + | ===== Example Session ===== |
- | NIL | + | |
- | (ITIMES broken) | + | For an example of basic Interlisp usage (defining a function, debugging, and saving it to a file), see [[https:// |
- | 6:BT | + | |
- | ITIMES | + | |
- | COND | + | |
- | FACT | + | |
- | COND | + | |
- | FACT | + | |
- | COND | + | |
- | *ENV* | + | |
- | FACT | + | |
- | *ENV* | + | |
- | APPLY | + | |
- | *PROG*LAM | + | |
- | LISPX | + | |
- | ERRORSET | + | |
- | EVALQT | + | |
- | NIL | + | |
- | 7:N | + | ===== Interlisp Editor ===== |
- | 1 | + | |
- | 8:? | + | |
- | UNBOUND ATOM | + | For an introduction to Interlisp' |
- | ? | + | |
- | (ITIMES broken) | + | |
- | 9:EDITF(FACT) | + | |
- | edit | + | |
- | 1*(R NIL 1) | + | |
- | 2*OK | + | |
- | FACT | + | |
- | 10:RETURN 1 | + | |
- | ITIMES = 1 | + | |
- | 6 | + | |
- | 11_PP FACT | + | |
- | (FACT | + | ===== Hello, World! ===== |
- | [LAMBDA (N) **COMMENT** | + | |
- | (if (ZEROP N) | + | |
- | then 1 | + | |
- | else (ITIMES N (FACT (SUB1 N]) | + | |
- | (FACT) | + | |
- | 12_MAKEFILES() | + | |
- | ****NOTE: the following are not contained on any file: | + | |
- | the functions: FACT | + | |
- | want to say where the above go ? Yes | + | |
- | (functions) | + | |
- | FACT File name: FACT2.LISP | + | |
- | create new file FACT2.LISP ? Yes | + | |
- | FACT2.LISP... | + | |
- | (< | + | |
- | 13_LOGOUT() | + | |
- | @ | + | |
+ | The example session referenced above defines a recursive factorial function. Below is one way to define a Hello, World! function in Interlisp. After typing the definition, run the function by typing '' | ||
- | ===== References ===== | + | (DEFINEQ |
+ | (HELLO | ||
+ | [LAMBDA NIL (* edited: | ||
+ | " 6-Oct-2024 23:" | ||
+ | (PRIN1 " | ||
+ | quotation marks, then | ||
+ | CR-LF on standard | ||
+ | output) | ||
+ | (TERPRI]) | ||
+ | ) | ||
+ | | ||
- | Warren Teitelman. Interlisp Reference Manual. (1978). Accessed: October 3, 2024. [Online]. Available: https:// | ||
- | Clark Weissman. Lisp 1.5 Primer. (1967). Accessed: October 3, 2024. [Online]. Available: http:// | ||