|
20 | 20 | (define (maxima-input-var-row r) |
21 | 21 | (if (nnull? r) |
22 | 22 | (begin |
23 | | - (display ", ") |
| 23 | + (plugin-output ", ") |
24 | 24 | (plugin-input (car r)) |
25 | 25 | (maxima-input-var-row (cdr r)) |
26 | 26 | ) ;begin |
27 | 27 | ) ;if |
28 | 28 | ) ;define |
29 | 29 |
|
30 | 30 | (define (maxima-input-row r) |
31 | | - (display "[") |
| 31 | + (plugin-output "[") |
32 | 32 | (plugin-input (car r)) |
33 | 33 | (maxima-input-var-row (cdr r)) |
34 | | - (display "]") |
| 34 | + (plugin-output "]") |
35 | 35 | ) ;define |
36 | 36 |
|
37 | 37 | (define (maxima-input-var-rows t) |
38 | 38 | (if (nnull? t) |
39 | 39 | (begin |
40 | | - (display ", ") |
| 40 | + (plugin-output ", ") |
41 | 41 | (maxima-input-row (car t)) |
42 | 42 | (maxima-input-var-rows (cdr t)) |
43 | 43 | ) ;begin |
44 | 44 | ) ;if |
45 | 45 | ) ;define |
46 | 46 |
|
47 | 47 | (define (maxima-input-rows t) |
48 | | - (display "matrix(") |
| 48 | + (plugin-output "matrix(") |
49 | 49 | (maxima-input-row (car t)) |
50 | 50 | (maxima-input-var-rows (cdr t)) |
51 | | - (display ")") |
| 51 | + (plugin-output ")") |
52 | 52 | ) ;define |
53 | 53 |
|
54 | 54 | (define (maxima-input-descend-last args) |
|
59 | 59 | ) ;define |
60 | 60 |
|
61 | 61 | (define (maxima-input-det args) |
62 | | - (display "determinant(") |
| 62 | + (plugin-output "determinant(") |
63 | 63 | (maxima-input-descend-last args) |
64 | | - (display ")") |
| 64 | + (plugin-output ")") |
65 | 65 | ) ;define |
66 | 66 |
|
67 | 67 | (define (maxima-input-binom args) |
68 | | - (display "binomial(") |
| 68 | + (plugin-output "binomial(") |
69 | 69 | (plugin-input (car args)) |
70 | | - (display ",") |
| 70 | + (plugin-output ",") |
71 | 71 | (plugin-input (cadr args)) |
72 | | - (display ")") |
| 72 | + (plugin-output ")") |
73 | 73 | ) ;define |
74 | 74 |
|
75 | 75 | (define (maxima-input-sqrt args) |
76 | 76 | (if (= (length args) 1) |
77 | 77 | (begin |
78 | | - (display "sqrt(") |
| 78 | + (plugin-output "sqrt(") |
79 | 79 | (plugin-input (car args)) |
80 | | - (display ")") |
| 80 | + (plugin-output ")") |
81 | 81 | ) ;begin |
82 | 82 | (begin |
83 | | - (display "(") |
| 83 | + (plugin-output "(") |
84 | 84 | (plugin-input (car args)) |
85 | | - (display ")^(1/(") |
| 85 | + (plugin-output ")^(1/(") |
86 | 86 | (plugin-input (cadr args)) |
87 | | - (display "))") |
| 87 | + (plugin-output "))") |
88 | 88 | ) ;begin |
89 | 89 | ) ;if |
90 | 90 | ) ;define |
|
94 | 94 | (if (nnull? (cdr args)) |
95 | 95 | (begin |
96 | 96 | ;; both lower and upper index |
97 | | - (display "tmsum(") |
| 97 | + (plugin-output "tmsum(") |
98 | 98 | (plugin-input (car args)) |
99 | | - (display ",") |
| 99 | + (plugin-output ",") |
100 | 100 | (plugin-input (cadr args)) |
101 | | - (display ",") |
| 101 | + (plugin-output ",") |
102 | 102 | ) ;begin |
103 | 103 | (begin |
104 | 104 | ;; lower index only |
105 | | - (display "tmlsum(") |
| 105 | + (plugin-output "tmlsum(") |
106 | 106 | (plugin-input (car args)) |
107 | | - (display ",") |
| 107 | + (plugin-output ",") |
108 | 108 | ) ;begin |
109 | 109 | ) ;if |
110 | | - (display "tmsum(") |
| 110 | + (plugin-output "tmsum(") |
111 | 111 | ) ;if |
112 | 112 | ) ;define |
113 | 113 |
|
114 | 114 | (define (maxima-input-prod args) |
115 | 115 | (if (nnull? args) |
116 | 116 | (begin |
117 | | - (display "tmprod(") |
| 117 | + (plugin-output "tmprod(") |
118 | 118 | (plugin-input (car args)) |
119 | | - (if (nnull? (cdr args)) (begin (display ",") (plugin-input (cadr args)))) |
120 | | - (display ",") |
| 119 | + (if (nnull? (cdr args)) (begin (plugin-output ",") (plugin-input (cadr args)))) |
| 120 | + (plugin-output ",") |
121 | 121 | ) ;begin |
122 | | - (display "tmprod(") |
| 122 | + (plugin-output "tmprod(") |
123 | 123 | ) ;if |
124 | 124 | ) ;define |
125 | 125 |
|
126 | 126 | (define (maxima-input-int args) |
127 | 127 | (if (nnull? args) |
128 | 128 | (begin |
129 | | - (display "tmint(") |
| 129 | + (plugin-output "tmint(") |
130 | 130 | (plugin-input (car args)) |
131 | | - (if (nnull? (cdr args)) (begin (display ",") (plugin-input (cadr args)))) |
132 | | - (display ",") |
| 131 | + (if (nnull? (cdr args)) (begin (plugin-output ",") (plugin-input (cadr args)))) |
| 132 | + (plugin-output ",") |
133 | 133 | ) ;begin |
134 | | - (display "integrate(") |
| 134 | + (plugin-output "integrate(") |
135 | 135 | ) ;if |
136 | 136 | ) ;define |
137 | 137 |
|
|
147 | 147 | (cond ((== op "sum") (maxima-input-sum l)) |
148 | 148 | ((== op "prod") (maxima-input-prod l)) |
149 | 149 | ((== op "int") (maxima-input-int l)) |
150 | | - (else (display op) (display "(")) |
| 150 | + (else (plugin-output op) (plugin-output "(")) |
151 | 151 | ) ;cond |
152 | 152 | (plugin-input body) |
153 | | - (display ")") |
| 153 | + (plugin-output ")") |
154 | 154 | ) ;let* |
155 | 155 | ) ;define |
156 | 156 |
|
|
0 commit comments