**PDP-10 Maclisp** The ITS Lisp is called Maclisp, or PDP-10 Maclisp if necessary to disambiguate it against [[Multics Maclisp]]. Its direct ancestor is [[its_pdp6_lisp|PDP-6 LISP]]. The biggest difference between Multics Maclisp is PDP-10 version does not have "real" string data type, the PDP-10 Maclisp string is just a symbol with a special property been set. The good news is the ''format'' pretty printer function is still available to build strings with complex contents. **A sample MACLISP session on ITS using LEDIT MODE in EMACS** //LEDIT will work on both [[its_topics|ITS]] and [[TOPS-20]] ;tnx1.0e6 to GLS// KA ITS 1648 DDT 1547 TTY 52 ;System herald :login smith ;The luser logs in :lisp ;MACLISP is started LISP 2154 ;MACLISP version ALLOC? N ;Take the world defaults (plus 3.14 2.71) ;Add two numbers 5.85 (car '(simple list)) ;Return the CAR of a LIST SIMPLE (ledit) ;Enters EMACS in LEDIT MODE (defun sum-squares (a b) ;Typed into the EMACS buffer (plus (times a a (times b b)))) ;META-Z pushes DEFUN to the world ;CTRL-X Z returns to LISP ;READING FROM LEDIT SUN-SQUARES ;Back in LISP ;EDIT COMPLETED (sum-squares 2.0 3.0) ;call SUM-SQUARES 36.0 ;Returns the wrong number (ledit) ;Re-enter EMACS in LEDIT MODE CTRL-S (times a a ;Typed into EMACS ;Search for STRING (times a a (defun sum-squares (a b) ;Correct SUM-SQUARES (plus (times a a) (times b b))) ;META-Z pushes new DEFUN to world ;CTRL-X Z returns to LISP ;READING FROM LEDIT SUM-SQUARES ;Back in LISP ;EDIT COMPLETED (sum-squares 2.0 3.0) ;Call SUM-SQUARES again 13.0 ;Correct result //The LISP ... Editor ... LISP ... loop will no doubt be repeated many times.// **HELLO WORLD and LOOP examples** @maclisp ; start MACLISP at the TOPS-20 EXEC LISP 2122 ; MACLISP Version 2122 Alloc? n ; take the defaults * (defun HELLO () ; DEFINE FUNCTION "HELLO" (princ "Hello World!")) ; print characters "Hello World!" HELLO ; MACLISP reports a definition for the function "HELLO" (hello)Hello World! ; The function "HELLO" is called and "Hello World!" is printed T ; MACLISP reports T for a successful function call @maclisp LISP 2122 Alloc? n * (loop for x in '(a b c d e) ; Call the macro "LOOP" for VARIABLE "x" in a list of "a b c d e" do (print x)) ; DO a PRINT of the value of "x" ;Loading LOOP 725 ; MACLISP loads LOOP version 725 ;Loading DEFMAX 98 ; MACLISP loads DEFMAX version 98 A ; 1. X = A B ; 2. X = B C ; 3. X = C D ; 4. X = D E ; 5. X = E NIL ; DO called PRINT X which returned NIL because there was nothing ; left to PRINT in the list of "a b c d e" **MATH examples** @maclisp LISP 2122 Alloc? n * (+ 2 2) 4 (- 2 2) 0 (* 2 2) 4