SRRAT: use MRAT reader functions instead of CADDAR, etc.
[maxima.git] / archive / src / fake-plot.lisp
blob6c5046a2d7333b6e3efd4caa7f758157f8a19633
1 (in-package "MAXIMA")
3 (setq plot-stream 'plot-stream-fun)
4 (defun plot-stream-fun (&rest l)
5 (case (car l)
6 ((:any-tyi :tyi) (read-char))
7 (t (show (list 'plot-stream-fun l)))))
8 (defun pointi (x y)
9 (FUNCALL PLOT-STREAM ':plot-POINT X Y)
10 (setq pnt-status t last-x x last-y y screen-last-x x screen-last-y y))
13 (defvar *plot-file* t)
14 (defun vectori (x y)
15 (cond ((not (and (f= screen-last-x last-x)
16 (f= screen-last-y last-y)))
17 (format *plot-file* "~% ~d ~d ~d ~d" last-x last-y x y))
18 (t (format *plot-file* "~% ~d ~d" x y)))
20 ; (FUNCALL PLOT-STREAM ':plot-LINE LAST-X LAST-Y X Y)
21 (setq pnt-status t last-x x last-y y screen-last-x x screen-last-y y)
24 (setq char-height 8)
25 (DEFVAR PLOT-WIDTH 762)
26 (DEFVAR PLOT-HEIGHT 854)
27 (DEFVAR CHAR-HEIGHT 12)
28 (DEFVAR CHAR-WIDTH 8)
29 (defun send (&rest l)
30 (cond ((member :any-tyi l) (print "hi:") (read-char))
31 (t (show (list 'send l)))))
36 (defun quot (a &rest b)
37 (cond ((null b)
38 (quot 1 a))
40 ((null (cdr b))
41 (setq b (car b))
42 (cond ((and (integerp a) (integerp b))
43 (values (truncate a b)))
44 (t (if (= b 0) (float most-positive-single-float)
45 ( / a b)))))
46 (t (apply 'quot (quot a (car b)) (cdr b)))))
49 (DEFUN $PLOT_COMMAND (CMD)
50 (cond ((and (consp cmd)
51 (eq ':menu (first cmd))
52 (eq ':value (second (second cmd))))
53 (setq cmd (second (third (second cmd)))))
54 (t nil))
56 ; (IF (AND (LISTP CMD) (EQ ':MENU (FIRST CMD)) (EQ ':KBD (SECOND (SECOND CMD))))
57 ; (SETQ CMD (THIRD (SECOND CMD))))
58 (and (numberp cmd) (>= cmd 0) (setf cmd (code-char cmd)))
59 (CASE CMD
60 ((#\P #\p) (plot-3d) 'continue)
61 ((#\E #\e #\SPACE) (setq $replotting nil) ($ENDGRAPH)
62 '$DONE)
63 ((#\O #\o) (plot-options-choose)
64 ':replot)
65 ((#\H #\h) ':HARDCOPY)
66 ((#\N #\n) '$DONE)
67 ((#\R #\r) (plot-input-choose) :replot)
68 ((#\M #\m #\V #\v #\O #\o) (plot-options-choose)
69 ':replot)
70 (-1 'continue)
71 ((otherwise 'continue))))
73 #$window:[0,0,700,700]$