User Tools

Site Tools


its_survival_guide

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 Both sides next revision
its_survival_guide [2020/03/19 08:54]
lars
its_survival_guide [2020/04/07 18:51]
smj
Line 33: Line 33:
 | fg     | $P | :continue |  | fg     | $P | :continue | 
 | bg | CTRL-P | :proceed | | bg | CTRL-P | :proceed |
 +
 +
 +**A sample MACLISP session using LEDIT MODE in EMACS**
 +//;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.//
its_survival_guide.txt · Last modified: 2020/04/15 20:22 by smj