home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0963.lha / SIOD / scm / edit-list.scm < prev    next >
Text File  |  1993-02-22  |  2KB  |  44 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. (define (edit x)
  7.         (let ((story nil)
  8.               (not-done #t )
  9.               (car-read nil)
  10.               (times 0))
  11.              (writeln "S.I.O.D. structure editor")
  12.              (while not-done
  13.                     (print x)
  14.                     (newline)
  15.                     (display "EDIT > ")
  16.                     (set! car-read (read-char))
  17.                     (while (char=? car-read #\newline)
  18.                            (set! car-read (read-char)))
  19.                     (cond ((char=? car-read #\n ) (set! times (read))
  20.                                                  (when (pair? x)
  21.                                                        (set! story (cons x story))
  22.                                                        (set! x (cdr x))))
  23.                           ((char=? car-read #\p ) (set! times (read))
  24.                                                  (when (pair? story)
  25.                                                        (set! x (car story))
  26.                                                        (set! story (cdr story))))
  27.                           ((char=? car-read #\e ) (display "delete what?")
  28.                                                  (set! x (delete! (read) x))) 
  29.                           ((char=? car-read #\f ) (display "find what?")
  30.                                                  (member (read) x))
  31.                           ((char=? car-read #\d )  (if (pair? (car x))
  32.                                                      (begin (set! story (cons x story))
  33.                                                             (set! x (car x)))
  34.                                                      (writeln "can't move down to sublist")))
  35.                           ((char=? car-read #\h ) (writeln "n<number> -- move on next pair")
  36.                                                  (writeln "p<number> -- move on previous pair")
  37.                                                  (writeln "d -- move on")
  38.                                                  (writeln "h -- help")
  39.                                                  (writeln "f -- find")
  40.                                                  (writeln "r -- reset to top level")
  41.                                                  (writeln "e -- delete")
  42.                                                  (writeln "q -- quit"))
  43.                           ((char=? car-read #\q ) (set! not-done #f))))))
  44.