User Tools

Site Tools


tutorials:interlisp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:interlisp [2024/10/06 12:33]
papa
tutorials:interlisp [2024/10/09 01:58] (current)
papa
Line 26: Line 26:
   * Although the Interlisp programming language is not identical to Lisp 1.5, Clark Weissman's __Lisp 1.5 Primer__((Clark Weissman. Lisp 1.5 Primer. (1967). Accessed: October 3, 2024. [Online]. Available: http://www.softwarepreservation.org/projects/LISP/book/Weismann_LISP1.5_Primer_1967.pdf)) is recommended as an introduction for Interlisp users.   * Although the Interlisp programming language is not identical to Lisp 1.5, Clark Weissman's __Lisp 1.5 Primer__((Clark Weissman. Lisp 1.5 Primer. (1967). Accessed: October 3, 2024. [Online]. Available: http://www.softwarepreservation.org/projects/LISP/book/Weismann_LISP1.5_Primer_1967.pdf)) is recommended as an introduction for Interlisp users.
   * The Interlisp top-level prompt character is a "_"   * The Interlisp top-level prompt character is a "_"
-  * Interlisp supports both upperand lower-case characters, and names are case-sensitiveNames of core functions are defined in uppercasebut the DWIM facility can automatically correct incorrect capitalization.+  * The Interlisp top-level allows expressions to be entered over multiple lines. Type a carriage-return to continue input on a new lineTo make Interlisp evaluate an input expressiontype 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:   * The Interlisp top-level accepts commands in either of two formats:
     - EVAL format: ''(//s-expression//)''     - EVAL format: ''(//s-expression//)''
     - EVALQUOTE format: ''//function//(//arguments//)''      - EVALQUOTE format: ''//function//(//arguments//)'' 
 +  * 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 ("]") as "super-parentheses": a right square bracket automatically supplies enough right parentheses to match back to the last left square bracket (in the expression being read), or if none has appeared, to match the first left parentheses, e.g., ''(A (B (C] => (A (B (C)))'', ''(A [B (C (D] E) => (A (B (C (D))) E)''   * The Interlisp read program treats square brackets ("]") as "super-parentheses": a right square bracket automatically supplies enough right parentheses to match back to the last left square bracket (in the expression being read), or if none has appeared, to match the first left parentheses, e.g., ''(A (B (C] => (A (B (C)))'', ''(A [B (C (D] E) => (A (B (C (D))) E)''
   * You can insert comments in your Interlisp code with ''(* //comment//)''. Comments will be included when functions are saved to a file, and displayed with the function definition by __getd__. __Prettyprint__ displays all comments as "%%**%% COMMENT %%**%%"   * You can insert comments in your Interlisp code with ''(* //comment//)''. Comments will be included when functions are saved to a file, and displayed with the function definition by __getd__. __Prettyprint__ displays all comments as "%%**%% COMMENT %%**%%"
Line 50: Line 51:
  
 For an example of basic Interlisp usage (defining a function, debugging, and saving it to a file), see [[https://papa.sdf.org/cave/twenex/interlisp-ex.html|Interlisp Example Session on TWENEX]]. For an example of basic Interlisp usage (defining a function, debugging, and saving it to a file), see [[https://papa.sdf.org/cave/twenex/interlisp-ex.html|Interlisp Example Session on TWENEX]].
 +
 +===== Interlisp Editor =====
 +
 +For an introduction to Interlisp's list structure oriented editor, see [[https://papa.sdf.org/cave/twenex/interlisp-editor.html|The Interlisp Editor]].
 +
 +===== Hello, World! =====
 +
 +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 ''HELLO()''.
 +
 +  (DEFINEQ
 +  (HELLO
 +    [LAMBDA NIL                                   (* edited:
 +                                                  " 6-Oct-2024 23:")
 +      (PRIN1 "Hello, World!"                    (* Print string without
 +                                                  quotation marks, then
 +                                                  CR-LF on standard
 +                                                  output)
 +      (TERPRI])
 +  )
 +  
  
  
  
tutorials/interlisp.1728217990.txt.gz ยท Last modified: 2024/10/06 12:33 by papa